| | | | |
|---|
| _Z4treeB5cxx11i | | | | | |
|---|
| | | | | ./ass1.cpp |
|---|
| | | | | #include <stdio.h>
|
|---|
| | | | | #include <iostream>
|
|---|
| | | | | #include <vector>
|
|---|
| | | | | #include <string>
|
|---|
| | | | | #include "ass1.h"
|
|---|
| | | | | using namespace std;
|
|---|
| 4012d6 | 55 | push | %rbp | | vector<string> tree(int n) {
|
|---|
| 4012ef | 83 bd c4 fe ff ff 01 | cmpl | $0x1,-0x13c(%rbp) | | if (n == 1) {
|
|---|
| 4012fc | 48 8d 85 d0 fe ff ff | lea | -0x130(%rbp),%rax | | vector<string> to_return;
|
|---|
| 40130b | 48 8d 85 5f ff ff ff | lea | -0xa1(%rbp),%rax | | to_return.push_back("(.)");
|
|---|
| 401335 | 48 8d 95 30 ff ff ff | lea | -0xd0(%rbp),%rdx | | |
|---|
| 40134e | 48 8d 85 30 ff ff ff | lea | -0xd0(%rbp),%rax | | |
|---|
| 40136c | 48 8d 95 d0 fe ff ff | lea | -0x130(%rbp),%rdx | | return to_return;
|
|---|
| 401385 | 48 8d 85 d0 fe ff ff | lea | -0x130(%rbp),%rax | | vector<string> to_return;
|
|---|
| | | | | }
|
|---|
| 401399 | 48 8d 85 10 ff ff ff | lea | -0xf0(%rbp),%rax | | vector<string> strings;
|
|---|
| 4013a8 | 8b 85 c4 fe ff ff | mov | -0x13c(%rbp),%eax | | vector<string> prev_strings = tree(n - 1);
|
|---|
| 4013c2 | c7 45 ec 00 00 00 00 | movl | $0x0,-0x14(%rbp) | | for (int i = 0; i < prev_strings.size(); i++) {
|
|---|
| 4013c9 | 8b 45 ec | mov | -0x14(%rbp),%eax | | |
|---|
| 4013cf | 48 8d 85 f0 fe ff ff | lea | -0x110(%rbp),%rax | | |
|---|
| 4013de | 48 39 c3 | cmp | %rax,%rbx | | |
|---|
| 4013ec | 8b 45 ec | mov | -0x14(%rbp),%eax | | strings.push_back("(" + prev_strings[i] + ".)");
|
|---|
| 401407 | 48 8d 45 80 | lea | -0x80(%rbp),%rax | | |
|---|
| 401418 | 48 8d 85 60 ff ff ff | lea | -0xa0(%rbp),%rax | | |
|---|
| 401433 | 48 8d 95 60 ff ff ff | lea | -0xa0(%rbp),%rdx | | |
|---|
| 40144c | 48 8d 85 60 ff ff ff | lea | -0xa0(%rbp),%rax | | |
|---|
| 40145b | 48 8d 45 80 | lea | -0x80(%rbp),%rax | | |
|---|
| 401467 | 8b 45 ec | mov | -0x14(%rbp),%eax | | strings.push_back("(." + prev_strings[i] + ")");
|
|---|
| 401482 | 48 8d 45 c0 | lea | -0x40(%rbp),%rax | | |
|---|
| 401493 | 48 8d 45 a0 | lea | -0x60(%rbp),%rax | | |
|---|
| 4014ab | 48 8d 55 a0 | lea | -0x60(%rbp),%rdx | | |
|---|
| 4014c1 | 48 8d 45 a0 | lea | -0x60(%rbp),%rax | | |
|---|
| 4014cd | 48 8d 45 c0 | lea | -0x40(%rbp),%rax | | |
|---|
| 4014d9 | 83 45 ec 01 | addl | $0x1,-0x14(%rbp) | | for (int i = 0; i < prev_strings.size(); i++) {
|
|---|
| | | | | }
|
|---|
| 4014e2 | 48 8d 95 10 ff ff ff | lea | -0xf0(%rbp),%rdx | | return strings;
|
|---|
| 4014fb | 48 8d 85 f0 fe ff ff | lea | -0x110(%rbp),%rax | | vector<string> prev_strings = tree(n - 1);
|
|---|
| | | | | }
|
|---|
| 40150a | 48 8d 85 10 ff ff ff | lea | -0xf0(%rbp),%rax | | vector<string> strings;
|
|---|
| 401521 | 48 8d 85 30 ff ff ff | lea | -0xd0(%rbp),%rax | | to_return.push_back("(.)");
|
|---|
| 401535 | 48 8d 85 5f ff ff ff | lea | -0xa1(%rbp),%rax | | |
|---|
| 401544 | 48 8d 85 d0 fe ff ff | lea | -0x130(%rbp),%rax | | vector<string> to_return;
|
|---|
| 401561 | 48 8d 85 60 ff ff ff | lea | -0xa0(%rbp),%rax | | strings.push_back("(" + prev_strings[i] + ".)");
|
|---|
| 401575 | 48 8d 45 80 | lea | -0x80(%rbp),%rax | | |
|---|
| 401586 | 48 8d 45 a0 | lea | -0x60(%rbp),%rax | | strings.push_back("(." + prev_strings[i] + ")");
|
|---|
| 401597 | 48 8d 45 c0 | lea | -0x40(%rbp),%rax | | |
|---|
| 4015a8 | 48 8d 85 f0 fe ff ff | lea | -0x110(%rbp),%rax | | vector<string> prev_strings = tree(n - 1);
|
|---|
| | | | | }
|
|---|
| 4015bc | 48 8d 85 10 ff ff ff | lea | -0xf0(%rbp),%rax | | vector<string> strings;
|
|---|
| 4015d6 | 48 8b 85 c8 fe ff ff | mov | -0x138(%rbp),%rax | | }
|
|---|
| | | | |
|---|
| main | | | | | |
|---|
| | | | |
|
|---|
| 4015e7 | 55 | push | %rbp | | int main() {
|
|---|
| 4015f0 | be 1f 30 40 00 | mov | $0x40301f,%esi | | cout << "Enter the number of nodes: ";
|
|---|
| | | | | int n;
|
|---|
| 4015ff | 48 8d 45 e8 | lea | -0x18(%rbp),%rax | | cin >> n;
|
|---|
| 401610 | 8b 55 e8 | mov | -0x18(%rbp),%edx | | vector<string> result = tree(n);
|
|---|
| 401621 | 8b 45 ec | mov | -0x14(%rbp),%eax | | for(int i; i < result.size(); i++) {
|
|---|
| 401627 | 48 8d 45 d0 | lea | -0x30(%rbp),%rax | | |
|---|
| 401633 | 48 39 c3 | cmp | %rax,%rbx | | |
|---|
| 40163d | 8b 45 ec | mov | -0x14(%rbp),%eax | | cout << result[i] << endl;
|
|---|
| 40165f | be 60 10 40 00 | mov | $0x401060,%esi | | |
|---|
| 40166c | 83 45 ec 01 | addl | $0x1,-0x14(%rbp) | | for(int i; i < result.size(); i++) {
|
|---|
| | | | | }
|
|---|
| 401672 | bb 00 00 00 00 | mov | $0x0,%ebx | | return 0;
|
|---|
| 401677 | 48 8d 45 d0 | lea | -0x30(%rbp),%rax | | vector<string> result = tree(n);
|
|---|
| 4016a1 | 48 83 c4 28 | add | $0x28,%rsp | | }
|
|---|
| | | | |
|---|
| _Z41__static_initialization_and_destruction_0ii | | | | | |
|---|
| 4016a8 | 55 | push | %rbp | | |
|---|
| 4016b6 | 83 7d fc 01 | cmpl | $0x1,-0x4(%rbp) | | |
|---|
| 4016bc | 81 7d f8 ff ff 00 00 | cmpl | $0xffff,-0x8(%rbp) | | |
|---|
| | | | | /usr/include/c++/9/iostream |
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | | // <http:
|
|---|
| | | | |
|
|---|
| | | | | /** @file include/iostream
|
|---|
| | | | | * This is a Standard C++ Library header.
|
|---|
| | | | | */
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | | #ifndef _GLIBCXX_IOSTREAM
|
|---|
| | | | | #define _GLIBCXX_IOSTREAM _GLIBCXX_IOSTREAM 1
_GLIBCXX_IOSTREAM 1
|
|---|
| | | | |
|
|---|
| | | | | #pragma GCC GCC system_header
GCC system_header
|
|---|
| | | | |
|
|---|
| | | | | #include <bits/c++config.h>
|
|---|
| | | | | #include <ostream>
|
|---|
| | | | | #include <istream>
|
|---|
| | | | |
|
|---|
| | | | | namespace std _GLIBCXX_VISIBILITY(default)
|
|---|
| | | | | {
|
|---|
| | | | | _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
|---|
| | | | |
|
|---|
| | | | | /**
|
|---|
| | | | | * @name Standard Stream Objects
|
|---|
| | | | | *
|
|---|
| | | | | * The <iostream> header declares the eight <em>standard stream
|
|---|
| | | | | * objects</em>. For other declarations, see
|
|---|
| | | | | * http:
|
|---|
| | | | | * and the @link iosfwd I/O forward declarations @endlink
|
|---|
| | | | | *
|
|---|
| | | | | * They are required by default to cooperate with the global C
|
|---|
| | | | | * library's @c FILE streams, and to be available during program
|
|---|
| | | | | * startup and termination. For more information, see the section of the
|
|---|
| | | | | * manual linked to above.
|
|---|
| | | | | */
|
|---|
| | | | |
|
|---|
| | | | | extern istream cin; /
|
|---|
| | | | | extern ostream cout; /
|
|---|
| | | | | extern ostream cerr; /
|
|---|
| | | | | extern ostream clog; /
|
|---|
| | | | |
|
|---|
| | | | | #ifdef _GLIBCXX_USE_WCHAR_T
|
|---|
| | | | | extern wistream wcin; /
|
|---|
| | | | | extern wostream wcout; /
|
|---|
| | | | | extern wostream wcerr; /
|
|---|
| | | | | extern wostream wclog; /
|
|---|
| | | | | #endif
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| 4016c5 | bf 39 63 40 00 | mov | $0x406339,%edi | | static ios_base::Init __ioinit;
|
|---|
| | | | | ./ass1.cpp |
|---|
| 4016e3 | 90 | nop | | | }
|
|---|
| | | | |
|---|
| _GLOBAL__sub_I__Z4treeB5cxx11i | | | | | |
|---|
| 4016e6 | 55 | push | %rbp | | |
|---|
| 4016ea | be ff ff 00 00 | mov | $0xffff,%esi | | |
|---|
| | | | |
|---|
| _ZnwmPv | | | | | |
|---|
| 4016fb | 55 | push | %rbp | | |
|---|
| | | | | /usr/include/c++/9/new |
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | | // <http:
|
|---|
| | | | |
|
|---|
| | | | | /** @file new
|
|---|
| | | | | * This is a Standard C++ Library header.
|
|---|
| | | | | *
|
|---|
| | | | | * The header @c new defines several functions to manage dynamic memory and
|
|---|
| | | | | * handling memory allocation errors; see
|
|---|
| | | | | * http:
|
|---|
| | | | | */
|
|---|
| | | | |
|
|---|
| | | | | #ifndef _NEW
|
|---|
| | | | | #define _NEW
|
|---|
| | | | |
|
|---|
| | | | | #pragma GCC GCC system_header
GCC system_header
|
|---|
| | | | |
|
|---|
| | | | | #include <bits/c++config.h>
|
|---|
| | | | | #include <exception>
|
|---|
| | | | |
|
|---|
| | | | | #pragma GCC GCC visibility GCC visibility push(default)
GCC visibility push(default)
GCC visibility GCC visibility push(default)
GCC visibility push(default)
|
|---|
| | | | |
|
|---|
| | | | | extern "C++" {
|
|---|
| | | | |
|
|---|
| | | | | namespace std
|
|---|
| | | | | {
|
|---|
| | | | | /**
|
|---|
| | | | | * @brief Exception possibly thrown by @c new.
|
|---|
| | | | | * @ingroup exceptions
|
|---|
| | | | | *
|
|---|
| | | | | * @c bad_alloc (or classes derived from it) is used to report allocation
|
|---|
| | | | | * errors from the throwing forms of @c new. */
|
|---|
| | | | | class bad_alloc : public exception
|
|---|
| | | | | {
|
|---|
| | | | | public:
|
|---|
| | | | | bad_alloc() throw() { }
|
|---|
| | | | |
|
|---|
| | | | | #if __cplusplus __cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
__cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
|
|---|
| | | | | bad_alloc(const bad_alloc&) = default;
|
|---|
| | | | | bad_alloc& operator=(const bad_alloc&) = default;
|
|---|
| | | | | #endif
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | | // http:
|
|---|
| | | | | virtual ~bad_alloc() throw();
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | | virtual const char* what() const throw">throw();
|
|---|
| | | | | };
|
|---|
| | | | |
|
|---|
| | | | | #if __cplusplus __cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
__cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
|
|---|
| | | | | class bad_array_new_length : public bad_alloc
|
|---|
| | | | | {
|
|---|
| | | | | public:
|
|---|
| | | | | bad_array_new_length() throw() { }
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | | // http:
|
|---|
| | | | | virtual ~bad_array_new_length() throw();
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | | virtual const char* what() const throw">throw();
|
|---|
| | | | | };
|
|---|
| | | | | #endif
|
|---|
| | | | |
|
|---|
| | | | | #if __cpp_aligned_new
|
|---|
| | | | | enum class align_val_t: size_t {};
|
|---|
| | | | | #endif
|
|---|
| | | | |
|
|---|
| | | | | struct nothrow_t
|
|---|
| | | | | {
|
|---|
| | | | | #if __cplusplus __cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
__cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
|
|---|
| | | | | explicit nothrow_t() = default;
|
|---|
| | | | | #endif
|
|---|
| | | | | };
|
|---|
| | | | |
|
|---|
| | | | | extern const nothrow_t nothrow;
|
|---|
| | | | |
|
|---|
| | | | | /** If you write your own error handler to be called by @c new, it must
|
|---|
| | | | | * be of this type. */
|
|---|
| | | | | typedef void (*new_handler)();
|
|---|
| | | | |
|
|---|
| | | | | /
|
|---|
| | | | | /
|
|---|
| | | | | new_handler set_new_handler(new_handler) throw();
|
|---|
| | | | |
|
|---|
| | | | | #if __cplusplus __cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
__cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
|
|---|
| | | | | /
|
|---|
| | | | | new_handler get_new_handler() noexcept;
|
|---|
| | | | | #endif
|
|---|
| | | | | }
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | | /** These are replaceable signatures:
|
|---|
| | | | | * - normal single new and delete (no arguments, throw @c bad_alloc on error)
|
|---|
| | | | | * - normal array new and delete (same)
|
|---|
| | | | | * - @c nothrow single new and delete (take a @c nothrow argument, return
|
|---|
| | | | | * @c NULL on error)
|
|---|
| | | | | * - @c nothrow array new and delete (same)
|
|---|
| | | | | *
|
|---|
| | | | | * Placement new and delete signatures (take a memory address argument,
|
|---|
| | | | | * does nothing) may not be replaced by a user's program.
|
|---|
| | | | | */
|
|---|
| | | | | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc)
|
|---|
| | | | | __attribute__((__externally_visible__));
|
|---|
| | | | | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
|
|---|
| | | | | __attribute__((__externally_visible__));
|
|---|
| | | | | void operator delete(void*) _GLIBCXX_USE_NOEXCEPT
|
|---|
| | | | | __attribute__((__externally_visible__));
|
|---|
| | | | | void operator delete[](void*) _GLIBCXX_USE_NOEXCEPT
|
|---|
| | | | | __attribute__((__externally_visible__));
|
|---|
| | | | | #if __cpp_sized_deallocation
|
|---|
| | | | | void operator delete(void*, std::size_t) _GLIBCXX_USE_NOEXCEPT
|
|---|
| | | | | __attribute__((__externally_visible__));
|
|---|
| | | | | void operator delete[](void*, std::size_t) _GLIBCXX_USE_NOEXCEPT
|
|---|
| | | | | __attribute__((__externally_visible__));
|
|---|
| | | | | #endif
|
|---|
| | | | | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
|
|---|
| | | | | __attribute__((__externally_visible__, __malloc__));
|
|---|
| | | | | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
|
|---|
| | | | | __attribute__((__externally_visible__, __malloc__));
|
|---|
| | | | | void operator delete(void*, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
|
|---|
| | | | | __attribute__((__externally_visible__));
|
|---|
| | | | | void operator delete[](void*, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
|
|---|
| | | | | __attribute__((__externally_visible__));
|
|---|
| | | | | #if __cpp_aligned_new
|
|---|
| | | | | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t)
|
|---|
| | | | | __attribute__((__externally_visible__));
|
|---|
| | | | | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&)
|
|---|
| | | | | _GLIBCXX_USE_NOEXCEPT __attribute__((__externally_visible__, __malloc__));
|
|---|
| | | | | void operator delete(void*, std::align_val_t)
|
|---|
| | | | | _GLIBCXX_USE_NOEXCEPT __attribute__((__externally_visible__));
|
|---|
| | | | | void operator delete(void*, std::align_val_t, const std::nothrow_t&)
|
|---|
| | | | | _GLIBCXX_USE_NOEXCEPT __attribute__((__externally_visible__));
|
|---|
| | | | | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t)
|
|---|
| | | | | __attribute__((__externally_visible__));
|
|---|
| | | | | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&)
|
|---|
| | | | | _GLIBCXX_USE_NOEXCEPT __attribute__((__externally_visible__, __malloc__));
|
|---|
| | | | | void operator delete[](void*, std::align_val_t)
|
|---|
| | | | | _GLIBCXX_USE_NOEXCEPT __attribute__((__externally_visible__));
|
|---|
| | | | | void operator delete[](void*, std::align_val_t, const std::nothrow_t&)
|
|---|
| | | | | _GLIBCXX_USE_NOEXCEPT __attribute__((__externally_visible__));
|
|---|
| | | | | #if __cpp_sized_deallocation
|
|---|
| | | | | void operator delete(void*, std::size_t, std::align_val_t)
|
|---|
| | | | | _GLIBCXX_USE_NOEXCEPT __attribute__((__externally_visible__));
|
|---|
| | | | | void operator delete[](void*, std::size_t, std::align_val_t)
|
|---|
| | | | | _GLIBCXX_USE_NOEXCEPT __attribute__((__externally_visible__));
|
|---|
| | | | | #endif //
|
|---|
| | | | | #endif //
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | | _GLIBCXX_NODISCARD inline void* operator new(std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT
|
|---|
| 401707 | 48 8b 45 f0 | mov | -0x10(%rbp),%rax | | { return __p; }
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | | // <http:
|
|---|
| | | | |
|
|---|
| | | | | /** @file new
|
|---|
| | | | | * This is a Standard C++ Library header.
|
|---|
| | | | | *
|
|---|
| | | | | * The header @c new defines several functions to manage dynamic memory and
|
|---|
| | | | | * handling memory allocation errors; see
|
|---|
| | | | | * http:
|
|---|
| | | | | */
|
|---|
| | | | |
|
|---|
| | | | | #ifndef _NEW
|
|---|
| | | | | #define _NEW
|
|---|
| | | | |
|
|---|
| | | | | #pragma GCC GCC system_header
GCC system_header
|
|---|
| | | | |
|
|---|
| | | | | #include <bits/c++config.h>
|
|---|
| | | | | #include <exception>
|
|---|
| | | | |
|
|---|
| | | | | #pragma GCC GCC visibility GCC visibility push(default)
GCC visibility push(default)
GCC visibility GCC visibility push(default)
GCC visibility push(default)
|
|---|
| | | | |
|
|---|
| | | | | extern "C++" {
|
|---|
| | | | |
|
|---|
| | | | | namespace std
|
|---|
| | | | | {
|
|---|
| | | | | /**
|
|---|
| | | | | * @brief Exception possibly thrown by @c new.
|
|---|
| | | | | * @ingroup exceptions
|
|---|
| | | | | *
|
|---|
| | | | | * @c bad_alloc (or classes derived from it) is used to report allocation
|
|---|
| | | | | * errors from the throwing forms of @c new. */
|
|---|
| | | | | class bad_alloc : public exception
|
|---|
| | | | | {
|
|---|
| | | | | public:
|
|---|
| | | | | bad_alloc() throw() { }
|
|---|
| | | | |
|
|---|
| | | | | #if __cplusplus __cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
__cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
|
|---|
| | | | | bad_alloc(const bad_alloc&) = default;
|
|---|
| | | | | bad_alloc& operator=(const bad_alloc&) = default;
|
|---|
| | | | | #endif
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | | // http:
|
|---|
| | | | | virtual ~bad_alloc() throw();
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | | virtual const char* what() const throw">throw();
|
|---|
| | | | | };
|
|---|
| | | | |
|
|---|
| | | | | #if __cplusplus __cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
__cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
|
|---|
| | | | | class bad_array_new_length : public bad_alloc
|
|---|
| | | | | {
|
|---|
| | | | | public:
|
|---|
| | | | | bad_array_new_length() throw() { }
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | | // http:
|
|---|
| | | | | virtual ~bad_array_new_length() throw();
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | | virtual const char* what() const throw">throw();
|
|---|
| | | | | };
|
|---|
| | | | | #endif
|
|---|
| | | | |
|
|---|
| | | | | #if __cpp_aligned_new
|
|---|
| | | | | enum class align_val_t: size_t {};
|
|---|
| | | | | #endif
|
|---|
| | | | |
|
|---|
| | | | | struct nothrow_t
|
|---|
| | | | | {
|
|---|
| | | | | #if __cplusplus __cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
__cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
|
|---|
| | | | | explicit nothrow_t() = default;
|
|---|
| | | | | #endif
|
|---|
| | | | | };
|
|---|
| | | | |
|
|---|
| | | | | extern const nothrow_t nothrow;
|
|---|
| | | | |
|
|---|
| | | | | /** If you write your own error handler to be called by @c new, it must
|
|---|
| | | | | * be of this type. */
|
|---|
| | | | | typedef void (*new_handler)();
|
|---|
| | | | |
|
|---|
| | | | | /
|
|---|
| | | | | /
|
|---|
| | | | | new_handler set_new_handler(new_handler) throw();
|
|---|
| | | | |
|
|---|
| | | | | #if __cplusplus __cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
__cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
|
|---|
| | | | | /
|
|---|
| | | | | new_handler get_new_handler() noexcept;
|
|---|
| | | | | #endif
|
|---|
| | | | | }
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | | /** These are replaceable signatures:
|
|---|
| | | | | * - normal single new and delete (no arguments, throw @c bad_alloc on error)
|
|---|
| | | | | * - normal array new and delete (same)
|
|---|
| | | | | * - @c nothrow single new and delete (take a @c nothrow argument, return
|
|---|
| | | | | * @c NULL on error)
|
|---|
| | | | | * - @c nothrow array new and delete (same)
|
|---|
| | | | | *
|
|---|
| | | | | * Placement new and delete signatures (take a memory address argument,
|
|---|
| | | | | * does nothing) may not be replaced by a user's program.
|
|---|
| | | | | */
|
|---|
| | | | | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc)
|
|---|
| | | | | __attribute__((__externally_visible__));
|
|---|
| | | | | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
|
|---|
| | | | | __attribute__((__externally_visible__));
|
|---|
| | | | | void operator delete(void*) _GLIBCXX_USE_NOEXCEPT
|
|---|
| | | | | __attribute__((__externally_visible__));
|
|---|
| | | | | void operator delete[](void*) _GLIBCXX_USE_NOEXCEPT
|
|---|
| | | | | __attribute__((__externally_visible__));
|
|---|
| | | | | #if __cpp_sized_deallocation
|
|---|
| | | | | void operator delete(void*, std::size_t) _GLIBCXX_USE_NOEXCEPT
|
|---|
| | | | | __attribute__((__externally_visible__));
|
|---|
| | | | | void operator delete[](void*, std::size_t) _GLIBCXX_USE_NOEXCEPT
|
|---|
| | | | | __attribute__((__externally_visible__));
|
|---|
| | | | | #endif
|
|---|
| | | | | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
|
|---|
| | | | | __attribute__((__externally_visible__, __malloc__));
|
|---|
| | | | | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
|
|---|
| | | | | __attribute__((__externally_visible__, __malloc__));
|
|---|
| | | | | void operator delete(void*, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
|
|---|
| | | | | __attribute__((__externally_visible__));
|
|---|
| | | | | void operator delete[](void*, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
|
|---|
| | | | | __attribute__((__externally_visible__));
|
|---|
| | | | | #if __cpp_aligned_new
|
|---|
| | | | | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t)
|
|---|
| | | | | __attribute__((__externally_visible__));
|
|---|
| | | | | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&)
|
|---|
| | | | | _GLIBCXX_USE_NOEXCEPT __attribute__((__externally_visible__, __malloc__));
|
|---|
| | | | | void operator delete(void*, std::align_val_t)
|
|---|
| | | | | _GLIBCXX_USE_NOEXCEPT __attribute__((__externally_visible__));
|
|---|
| | | | | void operator delete(void*, std::align_val_t, const std::nothrow_t&)
|
|---|
| | | | | _GLIBCXX_USE_NOEXCEPT __attribute__((__externally_visible__));
|
|---|
| | | | | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t)
|
|---|
| | | | | __attribute__((__externally_visible__));
|
|---|
| | | | | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&)
|
|---|
| | | | | _GLIBCXX_USE_NOEXCEPT __attribute__((__externally_visible__, __malloc__));
|
|---|
| | | | | void operator delete[](void*, std::align_val_t)
|
|---|
| | | | | _GLIBCXX_USE_NOEXCEPT __attribute__((__externally_visible__));
|
|---|
| | | | | void operator delete[](void*, std::align_val_t, const std::nothrow_t&)
|
|---|
| | | | | _GLIBCXX_USE_NOEXCEPT __attribute__((__externally_visible__));
|
|---|
| | | | | #if __cpp_sized_deallocation
|
|---|
| | | | | void operator delete(void*, std::size_t, std::align_val_t)
|
|---|
| | | | | _GLIBCXX_USE_NOEXCEPT __attribute__((__externally_visible__));
|
|---|
| | | | | void operator delete[](void*, std::size_t, std::align_val_t)
|
|---|
| | | | | _GLIBCXX_USE_NOEXCEPT __attribute__((__externally_visible__));
|
|---|
| | | | | #endif //
|
|---|
| | | | | #endif //
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | | _GLIBCXX_NODISCARD inline void* operator new(std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT
|
|---|
| 40170b | 5d | pop | %rbp | | |
|---|
| | | | |
|---|
| _ZNSt11char_traitsIcE6lengthEPKc | | | | | |
|---|
| | | | | /usr/include/c++/9/bits/char_traits.h |
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | | // <http:
|
|---|
| | | | |
|
|---|
| | | | | /** @file bits/char_traits.h
|
|---|
| | | | | * This is an internal header file, included by other library headers.
|
|---|
| | | | | * Do not attempt to use it directly. @headername{string}
|
|---|
| | | | | */
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | | #ifndef _CHAR_TRAITS_H
|
|---|
| | | | | #define _CHAR_TRAITS_H _CHAR_TRAITS_H 1
_CHAR_TRAITS_H 1
|
|---|
| | | | |
|
|---|
| | | | | #pragma GCC GCC system_header
GCC system_header
|
|---|
| | | | |
|
|---|
| | | | | #include <bits/stl_algobase.h> <bits/stl_algobase.h> // <bits/stl_algobase.h> // std::copy, <bits/stl_algobase.h>
<bits/stl_algobase.h>
<bits/stl_algobase.h> // std::copy, <bits/stl_algobase.h>
<bits/stl_algobase.h>
<bits/stl_algobase.h> // <bits/stl_algobase.h> // std::copy, <bits/stl_algobase.h>
<bits/stl_algobase.h>
<bits/stl_algobase.h> // std::copy, <bits/stl_algobase.h>
<bits/stl_algobase.h>
|
|---|
| | | | | #include <bits/postypes.h> <bits/postypes.h> // <bits/postypes.h> // For <bits/postypes.h>
<bits/postypes.h>
<bits/postypes.h> // For <bits/postypes.h>
<bits/postypes.h>
<bits/postypes.h> // <bits/postypes.h> // For <bits/postypes.h>
<bits/postypes.h>
<bits/postypes.h> // For <bits/postypes.h>
<bits/postypes.h>
|
|---|
| | | | | #include <cwchar> <cwchar> // <cwchar> // For <cwchar> // For WEOF, <cwchar> // For WEOF, wmemmove, <cwchar> // For WEOF, wmemmove, wmemset, <cwchar>
<cwchar>
<cwchar> // For WEOF, wmemmove, wmemset, <cwchar>
<cwchar>
<cwchar> // For WEOF, wmemmove, <cwchar> // For WEOF, wmemmove, wmemset, <cwchar>
<cwchar>
<cwchar> // For WEOF, wmemmove, wmemset, <cwchar>
<cwchar>
<cwchar> // For WEOF, <cwchar> // For WEOF, wmemmove, <cwchar> // For WEOF, wmemmove, wmemset, <cwchar>
<cwchar>
<cwchar> // For WEOF, wmemmove, wmemset, <cwchar>
<cwchar>
<cwchar> // For WEOF, wmemmove, <cwchar> // For WEOF, wmemmove, wmemset, <cwchar>
<cwchar>
<cwchar> // For WEOF, wmemmove, wmemset, <cwchar>
<cwchar>
<cwchar> // For <cwchar> // For WEOF, <cwchar> // For WEOF, wmemmove, <cwchar> // For WEOF, wmemmove, wmemset, <cwchar>
<cwchar>
<cwchar> // For WEOF, wmemmove, wmemset, <cwchar>
<cwchar>
<cwchar> // For WEOF, wmemmove, <cwchar> // For WEOF, wmemmove, wmemset, <cwchar>
<cwchar>
<cwchar> // For WEOF, wmemmove, wmemset, <cwchar>
<cwchar>
<cwchar> // For WEOF, <cwchar> // For WEOF, wmemmove, <cwchar> // For WEOF, wmemmove, wmemset, <cwchar>
<cwchar>
<cwchar> // For WEOF, wmemmove, wmemset, <cwchar>
<cwchar>
<cwchar> // For WEOF, wmemmove, <cwchar> // For WEOF, wmemmove, wmemset, <cwchar>
<cwchar>
<cwchar> // For WEOF, wmemmove, wmemset, <cwchar>
<cwchar>
<cwchar> // <cwchar> // For <cwchar> // For WEOF, <cwchar> // For WEOF, wmemmove, <cwchar> // For WEOF, wmemmove, wmemset, <cwchar>
<cwchar>
<cwchar> // For WEOF, wmemmove, wmemset, <cwchar>
<cwchar>
<cwchar> // For WEOF, wmemmove, <cwchar> // For WEOF, wmemmove, wmemset, <cwchar>
<cwchar>
<cwchar> // For WEOF, wmemmove, wmemset, <cwchar>
<cwchar>
<cwchar> // For WEOF, <cwchar> // For WEOF, wmemmove, <cwchar> // For WEOF, wmemmove, wmemset, <cwchar>
<cwchar>
<cwchar> // For WEOF, wmemmove, wmemset, <cwchar>
<cwchar>
<cwchar> // For WEOF, wmemmove, <cwchar> // For WEOF, wmemmove, wmemset, <cwchar>
<cwchar>
<cwchar> // For WEOF, wmemmove, wmemset, <cwchar>
<cwchar>
<cwchar> // For <cwchar> // For WEOF, <cwchar> // For WEOF, wmemmove, <cwchar> // For WEOF, wmemmove, wmemset, <cwchar>
<cwchar>
<cwchar> // For WEOF, wmemmove, wmemset, <cwchar>
<cwchar>
<cwchar> // For WEOF, wmemmove, <cwchar> // For WEOF, wmemmove, wmemset, <cwchar>
<cwchar>
<cwchar> // For WEOF, wmemmove, wmemset, <cwchar>
<cwchar>
<cwchar> // For WEOF, <cwchar> // For WEOF, wmemmove, <cwchar> // For WEOF, wmemmove, wmemset, <cwchar>
<cwchar>
<cwchar> // For WEOF, wmemmove, wmemset, <cwchar>
<cwchar>
<cwchar> // For WEOF, wmemmove, <cwchar> // For WEOF, wmemmove, wmemset, <cwchar>
<cwchar>
<cwchar> // For WEOF, wmemmove, wmemset, <cwchar>
<cwchar>
|
|---|
| | | | |
|
|---|
| | | | | #ifndef _GLIBCXX_ALWAYS_INLINE
|
|---|
| | | | | # define define _GLIBCXX_ALWAYS_INLINE define _GLIBCXX_ALWAYS_INLINE inline define _GLIBCXX_ALWAYS_INLINE inline __attribute__((__always_inline__))
__attribute__((__always_define _GLIBCXX_ALWAYS_INLINE inline define _GLIBCXX_ALWAYS_INLINE inline __attribute__((__always_inline__))
__))
define _GLIBCXX_ALWAYS_INLINE inline define _GLIBCXX_ALWAYS_INLINE inline __attribute__((__always_inline__))
__attribute__((__always_define _GLIBCXX_ALWAYS_INLINE inline define _GLIBCXX_ALWAYS_INLINE inline __attribute__((__always_inline__))
__))
define _GLIBCXX_ALWAYS_INLINE define _GLIBCXX_ALWAYS_INLINE inline define _GLIBCXX_ALWAYS_INLINE inline __attribute__((__always_inline__))
__attribute__((__always_define _GLIBCXX_ALWAYS_INLINE inline define _GLIBCXX_ALWAYS_INLINE inline __attribute__((__always_inline__))
__))
define _GLIBCXX_ALWAYS_INLINE inline define _GLIBCXX_ALWAYS_INLINE inline __attribute__((__always_inline__))
__attribute__((__always_define _GLIBCXX_ALWAYS_INLINE inline define _GLIBCXX_ALWAYS_INLINE inline __attribute__((__always_inline__))
__))
|
|---|
| | | | | #endif
|
|---|
| | | | |
|
|---|
| | | | | namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
|
|---|
| | | | | {
|
|---|
| | | | | _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
|---|
| | | | |
|
|---|
| | | | | /**
|
|---|
| | | | | * @brief Mapping from character type to associated types.
|
|---|
| | | | | *
|
|---|
| | | | | * @note This is an implementation class for the generic version
|
|---|
| | | | | * of char_traits. It defines int_type, off_type, pos_type, and
|
|---|
| | | | | * state_type. By default these are unsigned long, streamoff,
|
|---|
| | | | | * streampos, and mbstate_t. Users who need a different set of
|
|---|
| | | | | * types, but who don't need to change the definitions of any function
|
|---|
| | | | | * defined in char_traits, can specialize __gnu_cxx::_Char_types
|
|---|
| | | | | * while leaving __gnu_cxx::char_traits alone. */
|
|---|
| | | | | template<typename _CharT>
|
|---|
| | | | | struct _Char_types
|
|---|
| | | | | {
|
|---|
| | | | | typedef unsigned long int_type;
|
|---|
| | | | | typedef std::streampos pos_type;
|
|---|
| | | | | typedef std::streamoff off_type;
|
|---|
| | | | | typedef std::mbstate_t state_type;
|
|---|
| | | | | };
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | | /**
|
|---|
| | | | | * @brief Base class used to implement std::char_traits.
|
|---|
| | | | | *
|
|---|
| | | | | * @note For any given actual character type, this definition is
|
|---|
| | | | | * probably wrong. (Most of the member functions are likely to be
|
|---|
| | | | | * right, but the int_type and state_type typedefs, and the eof()
|
|---|
| | | | | * member function, are likely to be wrong.) The reason this class
|
|---|
| | | | | * exists is so users can specialize it. Classes in namespace std
|
|---|
| | | | | * may not be specialized for fundamental types, but classes in
|
|---|
| | | | | * namespace __gnu_cxx may be.
|
|---|
| | | | | *
|
|---|
| | | | | * See https:
|
|---|
| | | | | * for advice on how to make use of this class for @a unusual character
|
|---|
| | | | | * types. Also, check out include/ext/pod_char_traits.h.
|
|---|
| | | | | */
|
|---|
| | | | | template<typename _CharT>
|
|---|
| | | | | struct char_traits
|
|---|
| | | | | {
|
|---|
| | | | | typedef _CharT char_type;
|
|---|
| | | | | typedef typename _Char_types<_CharT>::int_type int_type;
|
|---|
| | | | | typedef typename _Char_types<_CharT>::pos_type pos_type;
|
|---|
| | | | | typedef typename _Char_types<_CharT>::off_type off_type;
|
|---|
| | | | | typedef typename _Char_types<_CharT>::state_type state_type;
|
|---|
| | | | |
|
|---|
| | | | | static _GLIBCXX14_CONSTEXPR void
|
|---|
| | | | | assign(char_type& __c1, const char_type& __c2)
|
|---|
| | | | | { __c1 = __c2; }
|
|---|
| | | | |
|
|---|
| | | | | static _GLIBCXX_CONSTEXPR bool
|
|---|
| | | | | eq(const char_type& __c1, const char_type& __c2)
|
|---|
| | | | | { return __c1 == __c2; }
|
|---|
| | | | |
|
|---|
| | | | | static _GLIBCXX_CONSTEXPR bool
|
|---|
| | | | | lt(const char_type& __c1, const char_type& __c2)
|
|---|
| | | | | { return __c1 < __c2; }
|
|---|
| | | | |
|
|---|
| | | | | static _GLIBCXX14_CONSTEXPR int
|
|---|
| | | | | compare(const char_type* __s1, const char_type* __s2, std::size_t __n);
|
|---|
| | | | |
|
|---|
| | | | | static _GLIBCXX14_CONSTEXPR std::size_t
|
|---|
| | | | | length(const char_type* __s);
|
|---|
| | | | |
|
|---|
| | | | | static _GLIBCXX14_CONSTEXPR const char_type*
|
|---|
| | | | | find(const char_type* __s, std::size_t __n, const char_type& __a);
|
|---|
| | | | |
|
|---|
| | | | | static char_type*
|
|---|
| | | | | move(char_type* __s1, const char_type* __s2, std::size_t __n);
|
|---|
| | | | |
|
|---|
| | | | | static char_type*
|
|---|
| | | | | copy(char_type* __s1, const char_type* __s2, std::size_t __n);
|
|---|
| | | | |
|
|---|
| | | | | static char_type*
|
|---|
| | | | | assign(char_type* __s, std::size_t __n, char_type __a);
|
|---|
| | | | |
|
|---|
| | | | | static _GLIBCXX_CONSTEXPR char_type
|
|---|
| | | | | to_char_type(const int_type& __c)
|
|---|
| | | | | { return static_cast<char_type>(__c); }
|
|---|
| | | | |
|
|---|
| | | | | static _GLIBCXX_CONSTEXPR int_type
|
|---|
| | | | | to_int_type(const char_type& __c)
|
|---|
| | | | | { return static_cast<int_type>(__c); }
|
|---|
| | | | |
|
|---|
| | | | | static _GLIBCXX_CONSTEXPR bool
|
|---|
| | | | | eq_int_type(const int_type& __c1, const int_type& __c2)
|
|---|
| | | | | { return __c1 == __c2; }
|
|---|
| | | | |
|
|---|
| | | | | static _GLIBCXX_CONSTEXPR int_type
|
|---|
| | | | | eof()
|
|---|
| | | | | { return static_cast<int_type>(_GLIBCXX_STDIO_EOF); }
|
|---|
| | | | |
|
|---|
| | | | | static _GLIBCXX_CONSTEXPR int_type
|
|---|
| | | | | not_eof(const int_type& __c)
|
|---|
| | | | | { return !eq_int_type(__c, eof()) ? __c : to_int_type(char_type()); }
|
|---|
| | | | | };
|
|---|
| | | | |
|
|---|
| | | | | template<typename _CharT>
|
|---|
| | | | | _GLIBCXX14_CONSTEXPR int
|
|---|
| | | | | char_traits<_CharT>::
|
|---|
| | | | | compare(const char_type* __s1, const char_type* __s2, std::size_t __n)
|
|---|
| | | | | {
|
|---|
| | | | | for (std::size_t __i = 0; __i < __n; ++__i)
|
|---|
| | | | | if (lt(__s1[__i], __s2[__i]))
|
|---|
| | | | | return -1;
|
|---|
| | | | | else if (lt(__s2[__i], __s1[__i]))
|
|---|
| | | | | return 1;
|
|---|
| | | | | return 0;
|
|---|
| | | | | }
|
|---|
| | | | |
|
|---|
| | | | | template<typename _CharT>
|
|---|
| | | | | _GLIBCXX14_CONSTEXPR std::size_t
|
|---|
| | | | | char_traits<_CharT>::
|
|---|
| | | | | length(const char_type* __p)
|
|---|
| | | | | {
|
|---|
| | | | | std::size_t __i = 0;
|
|---|
| | | | | while (!eq(__p[__i], char_type()))
|
|---|
| | | | | ++__i;
|
|---|
| | | | | return __i;
|
|---|
| | | | | }
|
|---|
| | | | |
|
|---|
| | | | | template<typename _CharT>
|
|---|
| | | | | _GLIBCXX14_CONSTEXPR const typename char_traits<_CharT>::char_type*
|
|---|
| | | | | char_traits<_CharT>::
|
|---|
| | | | | find(const char_type* __s, std::size_t __n, const char_type& __a)
|
|---|
| | | | | {
|
|---|
| | | | | for (std::size_t __i = 0; __i < __n; ++__i)
|
|---|
| | | | | if (eq(__s[__i], __a))
|
|---|
| | | | | return __s + __i;
|
|---|
| | | | | return 0;
|
|---|
| | | | | }
|
|---|
| | | | |
|
|---|
| | | | | template<typename _CharT>
|
|---|
| | | | | typename char_traits<_CharT>::char_type*
|
|---|
| | | | | char_traits<_CharT>::
|
|---|
| | | | | move(char_type* __s1, const char_type* __s2, std::size_t __n)
|
|---|
| | | | | {
|
|---|
| | | | | if (__n == 0)
|
|---|
| | | | | return __s1;
|
|---|
| | | | | return static_cast<_CharT*>(__builtin_memmove(__s1, __s2,
|
|---|
| | | | | __n * sizeof(char_type)));
|
|---|
| | | | | }
|
|---|
| | | | |
|
|---|
| | | | | template<typename _CharT>
|
|---|
| | | | | typename char_traits<_CharT>::char_type*
|
|---|
| | | | | char_traits<_CharT>::
|
|---|
| | | | | copy(char_type* __s1, const char_type* __s2, std::size_t __n)
|
|---|
| | | | | {
|
|---|
| | | | |
|
|---|
| | | | | std::copy(__s2, __s2 + __n, __s1);
|
|---|
| | | | | return __s1;
|
|---|
| | | | | }
|
|---|
| | | | |
|
|---|
| | | | | template<typename _CharT>
|
|---|
| | | | | typename char_traits<_CharT>::char_type*
|
|---|
| | | | | char_traits<_CharT>::
|
|---|
| | | | | assign(char_type* __s, std::size_t __n, char_type __a)
|
|---|
| | | | | {
|
|---|
| | | | |
|
|---|
| | | | | std::fill_n(__s, __n, __a);
|
|---|
| | | | | return __s;
|
|---|
| | | | | }
|
|---|
| | | | |
|
|---|
| | | | | _GLIBCXX_END_NAMESPACE_VERSION
|
|---|
| | | | | }
|
|---|
| | | | |
|
|---|
| | | | | namespace std _GLIBCXX_VISIBILITY(default)
|
|---|
| | | | | {
|
|---|
| | | | | _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
|---|
| | | | |
|
|---|
| | | | | #if __cplusplus __cplusplus >= __cplusplus >= 201703L
__cplusplus >= 201703L
__cplusplus >= __cplusplus >= 201703L
__cplusplus >= 201703L
|
|---|
| | | | | #define __cpp_lib_constexpr_char_traits __cpp_lib_constexpr_char_traits 201611
__cpp_lib_constexpr_char_traits 201611
|
|---|
| | | | |
|
|---|
| | | | | /**
|
|---|
| | | | | * @brief Determine whether the characters of a NULL-terminated
|
|---|
| | | | | * string are known at compile time.
|
|---|
| | | | | * @param __s The string.
|
|---|
| | | | | *
|
|---|
| | | | | * Assumes that _CharT is a built-in character type.
|
|---|
| | | | | */
|
|---|
| | | | | template<typename _CharT>
|
|---|
| | | | | static _GLIBCXX_ALWAYS_INLINE constexpr bool
|
|---|
| | | | | __constant_string_p(const _CharT* __s)
|
|---|
| | | | | {
|
|---|
| | | | | #ifdef _GLIBCXX_HAVE_BUILTIN_IS_CONSTANT_EVALUATED
|
|---|
| | | | | (void) __s;
|
|---|
| | | | |
|
|---|
| | | | | return __builtin_is_constant_evaluated();
|
|---|
| | | | | #else
|
|---|
| | | | | while (__builtin_constant_p(*__s) && *__s)
|
|---|
| | | | | __s++;
|
|---|
| | | | | return __builtin_constant_p(*__s);
|
|---|
| | | | | #endif
|
|---|
| | | | | }
|
|---|
| | | | |
|
|---|
| | | | | /**
|
|---|
| | | | | * @brief Determine whether the characters of a character array are
|
|---|
| | | | | * known at compile time.
|
|---|
| | | | | * @param __a The character array.
|
|---|
| | | | | * @param __n Number of characters.
|
|---|
| | | | | *
|
|---|
| | | | | * Assumes that _CharT is a built-in character type.
|
|---|
| | | | | */
|
|---|
| | | | | template<typename _CharT>
|
|---|
| | | | | static _GLIBCXX_ALWAYS_INLINE constexpr bool
|
|---|
| | | | | __constant_char_array_p(const _CharT* __a, size_t __n)
|
|---|
| | | | | {
|
|---|
| | | | | #ifdef _GLIBCXX_HAVE_BUILTIN_IS_CONSTANT_EVALUATED
|
|---|
| | | | | (void) __a;
|
|---|
| | | | | (void) __n;
|
|---|
| | | | |
|
|---|
| | | | | return __builtin_is_constant_evaluated();
|
|---|
| | | | | #else
|
|---|
| | | | | size_t __i = 0;
|
|---|
| | | | | while (__i < __n && __builtin_constant_p(__a[__i]))
|
|---|
| | | | | __i++;
|
|---|
| | | | | return __i == __n;
|
|---|
| | | | | #endif
|
|---|
| | | | | }
|
|---|
| | | | | #endif
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | | /**
|
|---|
| | | | | * @brief Basis for explicit traits specializations.
|
|---|
| | | | | *
|
|---|
| | | | | * @note For any given actual character type, this definition is
|
|---|
| | | | | * probably wrong. Since this is just a thin wrapper around
|
|---|
| | | | | * __gnu_cxx::char_traits, it is possible to achieve a more
|
|---|
| | | | | * appropriate definition by specializing __gnu_cxx::char_traits.
|
|---|
| | | | | *
|
|---|
| | | | | * See https:
|
|---|
| | | | | * for advice on how to make use of this class for @a unusual character
|
|---|
| | | | | * types. Also, check out include/ext/pod_char_traits.h.
|
|---|
| | | | | */
|
|---|
| | | | | template<class _CharT>
|
|---|
| | | | | struct char_traits : public __gnu_cxx::char_traits<_CharT>
|
|---|
| | | | | { };
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | | /
|
|---|
| | | | | template<>
|
|---|
| | | | | struct char_traits<char>
|
|---|
| | | | | {
|
|---|
| | | | | typedef char char_type;
|
|---|
| | | | | typedef int int_type;
|
|---|
| | | | | typedef streampos pos_type;
|
|---|
| | | | | typedef streamoff off_type;
|
|---|
| | | | | typedef mbstate_t state_type;
|
|---|
| | | | |
|
|---|
| | | | | static _GLIBCXX17_CONSTEXPR void
|
|---|
| | | | | assign(char_type& __c1, const char_type& __c2) _GLIBCXX_NOEXCEPT
|
|---|
| | | | | { __c1 = __c2; }
|
|---|
| | | | |
|
|---|
| | | | | static _GLIBCXX_CONSTEXPR bool
|
|---|
| | | | | eq(const char_type& __c1, const char_type& __c2) _GLIBCXX_NOEXCEPT
|
|---|
| | | | | { return __c1 == __c2; }
|
|---|
| | | | |
|
|---|
| | | | | static _GLIBCXX_CONSTEXPR bool
|
|---|
| | | | | lt(const char_type& __c1, const char_type& __c2) _GLIBCXX_NOEXCEPT
|
|---|
| | | | | {
|
|---|
| | | | |
|
|---|
| | | | | return (static_cast<unsigned char>(__c1)
|
|---|
| | | | | < static_cast<unsigned char>(__c2));
|
|---|
| | | | | }
|
|---|
| | | | |
|
|---|
| | | | | static _GLIBCXX17_CONSTEXPR int
|
|---|
| | | | | compare(const char_type* __s1, const char_type* __s2, size_t __n)
|
|---|
| | | | | {
|
|---|
| | | | | if (__n == 0)
|
|---|
| | | | | return 0;
|
|---|
| | | | | #if __cplusplus __cplusplus >= __cplusplus >= 201703L
__cplusplus >= 201703L
__cplusplus >= __cplusplus >= 201703L
__cplusplus >= 201703L
|
|---|
| | | | | if (__builtin_constant_p(__n)
|
|---|
| | | | | && __constant_char_array_p(__s1, __n)
|
|---|
| | | | | && __constant_char_array_p(__s2, __n))
|
|---|
| | | | | return __gnu_<span class="namespc">cxx</span>::char_traits<char_type>::compare(__s1, __s2, __n);
|
|---|
| | | | | #endif
|
|---|
| | | | | return __builtin_memcmp(__s1, __s2, __n);
|
|---|
| | | | | }
|
|---|
| | | | |
|
|---|
| | | | | static _GLIBCXX17_CONSTEXPR size_t
|
|---|
| 40170d | 55 | push | %rbp | | length(const char_type* __s)
|
|---|
| | | | | {
|
|---|
| | | | | #if __cplusplus __cplusplus >= __cplusplus >= 201703L
__cplusplus >= 201703L
__cplusplus >= __cplusplus >= 201703L
__cplusplus >= 201703L
|
|---|
| | | | | if (__constant_string_p(__s))
|
|---|
| | | | | return __gnu_<span class="namespc">cxx</span>::char_traits<char_type>::length(__s);
|
|---|
| | | | | #endif
|
|---|
| 401715 | 48 8b 45 f8 | mov | -0x8(%rbp),%rax | | return __builtin_strlen(__s);
|
|---|
| 401737 | 5d | pop | %rbp | | }
|
|---|
| 401739 | 90 | nop | | | |
|---|
| | | | |
|---|
| _ZNSt12_Vector_baseINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE12_Vector_implD1Ev | | | | | |
|---|
| | | | | /usr/include/c++/9/bits/stl_vector.h |
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | | // <http:
|
|---|
| | | | |
|
|---|
| | | | | /*
|
|---|
| | | | | *
|
|---|
| | | | | * Copyright (c) 1994
|
|---|
| | | | | * Hewlett-Packard Company
|
|---|
| | | | | *
|
|---|
| | | | | * Permission to use, copy, modify, distribute and sell this software
|
|---|
| | | | | * and its documentation for any purpose is hereby granted without fee,
|
|---|
| | | | | * provided that the above copyright notice appear in all copies and
|
|---|
| | | | | * that both that copyright notice and this permission notice appear
|
|---|
| | | | | * in supporting documentation. Hewlett-Packard Company makes no
|
|---|
| | | | | * representations about the suitability of this software for any
|
|---|
| | | | | * purpose. It is provided "as is" without express or implied warranty.
|
|---|
| | | | | *
|
|---|
| | | | | *
|
|---|
| | | | | * Copyright (c) 1996
|
|---|
| | | | | * Silicon Graphics Computer Systems, Inc.
|
|---|
| | | | | *
|
|---|
| | | | | * Permission to use, copy, modify, distribute and sell this software
|
|---|
| | | | | * and its documentation for any purpose is hereby granted without fee,
|
|---|
| | | | | * provided that the above copyright notice appear in all copies and
|
|---|
| | | | | * that both that copyright notice and this permission notice appear
|
|---|
| | | | | * in supporting documentation. Silicon Graphics makes no
|
|---|
| | | | | * representations about the suitability of this software for any
|
|---|
| | | | | * purpose. It is provided "as is" without express or implied warranty.
|
|---|
| | | | | */
|
|---|
| | | | |
|
|---|
| | | | | /** @file bits/stl_vector.h
|
|---|
| | | | | * This is an internal header file, included by other library headers.
|
|---|
| | | | | * Do not attempt to use it directly. @headername{vector}
|
|---|
| | | | | */
|
|---|
| | | | |
|
|---|
| | | | | #ifndef _STL_VECTOR_H
|
|---|
| | | | | #define _STL_VECTOR_H _STL_VECTOR_H 1
_STL_VECTOR_H 1
|
|---|
| | | | |
|
|---|
| | | | | #include <bits/stl_iterator_base_funcs.h>
|
|---|
| | | | | #include <bits/functexcept.h>
|
|---|
| | | | | #include <bits/concept_check.h>
|
|---|
| | | | | #if __cplusplus __cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
__cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
|
|---|
| | | | | #include <initializer_list>
|
|---|
| | | | | #endif
|
|---|
| | | | |
|
|---|
| | | | | #include <debug/assertions.h>
|
|---|
| | | | |
|
|---|
| | | | | #if _GLIBCXX_SANITIZE_STD_ALLOCATOR _GLIBCXX_SANITIZE_STD_ALLOCATOR && _GLIBCXX_SANITIZE_STD_ALLOCATOR && _GLIBCXX_SANITIZE_VECTOR
_GLIBCXX_SANITIZE_STD_ALLOCATOR && _GLIBCXX_SANITIZE_VECTOR
_GLIBCXX_SANITIZE_STD_ALLOCATOR && _GLIBCXX_SANITIZE_STD_ALLOCATOR && _GLIBCXX_SANITIZE_VECTOR
_GLIBCXX_SANITIZE_STD_ALLOCATOR && _GLIBCXX_SANITIZE_VECTOR
|
|---|
| | | | | extern "C" void
|
|---|
| | | | | __sanitizer_annotate_contiguous_container(const void*, const void*,
|
|---|
| | | | | const void*, const void*);
|
|---|
| | | | | #endif
|
|---|
| | | | |
|
|---|
| | | | | namespace std _GLIBCXX_VISIBILITY(default)
|
|---|
| | | | | {
|
|---|
| | | | | _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
|---|
| | | | | _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
|
|---|
| | | | |
|
|---|
| | | | | /
|
|---|
| | | | | template<typename _Tp, typename _Alloc>
|
|---|
| | | | | struct _Vector_base
|
|---|
| | | | | {
|
|---|
| | | | | typedef typename __gnu_<span class="namespc">cxx</span>::__alloc_traits<_Alloc>::template
|
|---|
| | | | | rebind<_Tp>::other _Tp_alloc_type;
|
|---|
| | | | | typedef typename __gnu_<span class="namespc">cxx</span>::__alloc_traits<_Tp_alloc_type>::pointer
|
|---|
| | | | | pointer;
|
|---|
| | | | |
|
|---|
| | | | | struct _Vector_impl_data
|
|---|
| | | | | {
|
|---|
| | | | | pointer _M_start;
|
|---|
| | | | | pointer _M_finish;
|
|---|
| | | | | pointer _M_end_of_storage;
|
|---|
| | | | |
|
|---|
| | | | | _Vector_impl_data() _GLIBCXX_NOEXCEPT
|
|---|
| | | | | : _M_start(), _M_finish(), _M_end_of_storage()
|
|---|
| | | | | { }
|
|---|
| | | | |
|
|---|
| | | | | #if __cplusplus __cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
__cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
|
|---|
| | | | | _Vector_impl_data(_Vector_impl_data&& __x) noexcept
|
|---|
| | | | | : _M_start(__x._M_start), _M_finish(__x._M_finish),
|
|---|
| | | | | _M_end_of_storage(__x._M_end_of_storage)
|
|---|
| | | | | { __x._M_start = __x._M_finish = __x._M_end_of_storage = pointer(); }
|
|---|
| | | | | #endif
|
|---|
| | | | |
|
|---|
| | | | | void
|
|---|
| | | | | _M_copy_data(_Vector_impl_data const& __x) _GLIBCXX_NOEXCEPT
|
|---|
| | | | | {
|
|---|
| | | | | _M_start = __x._M_start;
|
|---|
| | | | | _M_finish = __x._M_finish;
|
|---|
| | | | | _M_end_of_storage = __x._M_end_of_storage;
|
|---|
| | | | | }
|
|---|
| | | | |
|
|---|
| | | | | void
|
|---|
| | | | | _M_swap_data(_Vector_impl_data& __x) _GLIBCXX_NOEXCEPT
|
|---|
| | | | | {
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | | _Vector_impl_data __tmp;
|
|---|
| | | | | __tmp._M_copy_data(*this);
|
|---|
| | | | | _M_copy_data(__x);
|
|---|
| | | | | __x._M_copy_data(__tmp);
|
|---|
| | | | | }
|
|---|
| | | | | };
|
|---|
| | | | |
|
|---|
| 40173a | 55 | push | %rbp | | struct _Vector_impl
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | | // <http:
|
|---|
| | | | |
|
|---|
| | | | | /*
|
|---|
| | | | | *
|
|---|
| | | | | * Copyright (c) 1994
|
|---|
| | | | | * Hewlett-Packard Company
|
|---|
| | | | | *
|
|---|
| | | | | * Permission to use, copy, modify, distribute and sell this software
|
|---|
| | | | | * and its documentation for any purpose is hereby granted without fee,
|
|---|
| | | | | * provided that the above copyright notice appear in all copies and
|
|---|
| | | | | * that both that copyright notice and this permission notice appear
|
|---|
| | | | | * in supporting documentation. Hewlett-Packard Company makes no
|
|---|
| | | | | * representations about the suitability of this software for any
|
|---|
| | | | | * purpose. It is provided "as is" without express or implied warranty.
|
|---|
| | | | | *
|
|---|
| | | | | *
|
|---|
| | | | | * Copyright (c) 1996
|
|---|
| | | | | * Silicon Graphics Computer Systems, Inc.
|
|---|
| | | | | *
|
|---|
| | | | | * Permission to use, copy, modify, distribute and sell this software
|
|---|
| | | | | * and its documentation for any purpose is hereby granted without fee,
|
|---|
| | | | | * provided that the above copyright notice appear in all copies and
|
|---|
| | | | | * that both that copyright notice and this permission notice appear
|
|---|
| | | | | * in supporting documentation. Silicon Graphics makes no
|
|---|
| | | | | * representations about the suitability of this software for any
|
|---|
| | | | | * purpose. It is provided "as is" without express or implied warranty.
|
|---|
| | | | | */
|
|---|
| | | | |
|
|---|
| | | | | /** @file bits/stl_vector.h
|
|---|
| | | | | * This is an internal header file, included by other library headers.
|
|---|
| | | | | * Do not attempt to use it directly. @headername{vector}
|
|---|
| | | | | */
|
|---|
| | | | |
|
|---|
| | | | | #ifndef _STL_VECTOR_H
|
|---|
| | | | | #define _STL_VECTOR_H _STL_VECTOR_H 1
_STL_VECTOR_H 1
|
|---|
| | | | |
|
|---|
| | | | | #include <bits/stl_iterator_base_funcs.h>
|
|---|
| | | | | #include <bits/functexcept.h>
|
|---|
| | | | | #include <bits/concept_check.h>
|
|---|
| | | | | #if __cplusplus __cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
__cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
|
|---|
| | | | | #include <initializer_list>
|
|---|
| | | | | #endif
|
|---|
| | | | |
|
|---|
| | | | | #include <debug/assertions.h>
|
|---|
| | | | |
|
|---|
| | | | | #if _GLIBCXX_SANITIZE_STD_ALLOCATOR _GLIBCXX_SANITIZE_STD_ALLOCATOR && _GLIBCXX_SANITIZE_STD_ALLOCATOR && _GLIBCXX_SANITIZE_VECTOR
_GLIBCXX_SANITIZE_STD_ALLOCATOR && _GLIBCXX_SANITIZE_VECTOR
_GLIBCXX_SANITIZE_STD_ALLOCATOR && _GLIBCXX_SANITIZE_STD_ALLOCATOR && _GLIBCXX_SANITIZE_VECTOR
_GLIBCXX_SANITIZE_STD_ALLOCATOR && _GLIBCXX_SANITIZE_VECTOR
|
|---|
| | | | | extern "C" void
|
|---|
| | | | | __sanitizer_annotate_contiguous_container(const void*, const void*,
|
|---|
| | | | | const void*, const void*);
|
|---|
| | | | | #endif
|
|---|
| | | | |
|
|---|
| | | | | namespace std _GLIBCXX_VISIBILITY(default)
|
|---|
| | | | | {
|
|---|
| | | | | _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
|---|
| | | | | _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
|
|---|
| | | | |
|
|---|
| | | | | /
|
|---|
| | | | | template<typename _Tp, typename _Alloc>
|
|---|
| | | | | struct _Vector_base
|
|---|
| | | | | {
|
|---|
| | | | | typedef typename __gnu_<span class="namespc">cxx</span>::__alloc_traits<_Alloc>::template
|
|---|
| | | | | rebind<_Tp>::other _Tp_alloc_type;
|
|---|
| | | | | typedef typename __gnu_<span class="namespc">cxx</span>::__alloc_traits<_Tp_alloc_type>::pointer
|
|---|
| | | | | pointer;
|
|---|
| | | | |
|
|---|
| | | | | struct _Vector_impl_data
|
|---|
| | | | | {
|
|---|
| | | | | pointer _M_start;
|
|---|
| | | | | pointer _M_finish;
|
|---|
| | | | | pointer _M_end_of_storage;
|
|---|
| | | | |
|
|---|
| | | | | _Vector_impl_data() _GLIBCXX_NOEXCEPT
|
|---|
| | | | | : _M_start(), _M_finish(), _M_end_of_storage()
|
|---|
| | | | | { }
|
|---|
| | | | |
|
|---|
| | | | | #if __cplusplus __cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
__cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
|
|---|
| | | | | _Vector_impl_data(_Vector_impl_data&& __x) noexcept
|
|---|
| | | | | : _M_start(__x._M_start), _M_finish(__x._M_finish),
|
|---|
| | | | | _M_end_of_storage(__x._M_end_of_storage)
|
|---|
| | | | | { __x._M_start = __x._M_finish = __x._M_end_of_storage = pointer(); }
|
|---|
| | | | | #endif
|
|---|
| | | | |
|
|---|
| | | | | void
|
|---|
| | | | | _M_copy_data(_Vector_impl_data const& __x) _GLIBCXX_NOEXCEPT
|
|---|
| | | | | {
|
|---|
| | | | | _M_start = __x._M_start;
|
|---|
| | | | | _M_finish = __x._M_finish;
|
|---|
| | | | | _M_end_of_storage = __x._M_end_of_storage;
|
|---|
| | | | | }
|
|---|
| | | | |
|
|---|
| | | | | void
|
|---|
| | | | | _M_swap_data(_Vector_impl_data& __x) _GLIBCXX_NOEXCEPT
|
|---|
| | | | | {
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | | _Vector_impl_data __tmp;
|
|---|
| | | | | __tmp._M_copy_data(*this);
|
|---|
| | | | | _M_copy_data(__x);
|
|---|
| | | | | __x._M_copy_data(__tmp);
|
|---|
| | | | | }
|
|---|
| | | | | };
|
|---|
| | | | |
|
|---|
| 401746 | 48 8b 45 f8 | mov | -0x8(%rbp),%rax | | |
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | | // <http:
|
|---|
| | | | |
|
|---|
| | | | | /*
|
|---|
| | | | | *
|
|---|
| | | | | * Copyright (c) 1994
|
|---|
| | | | | * Hewlett-Packard Company
|
|---|
| | | | | *
|
|---|
| | | | | * Permission to use, copy, modify, distribute and sell this software
|
|---|
| | | | | * and its documentation for any purpose is hereby granted without fee,
|
|---|
| | | | | * provided that the above copyright notice appear in all copies and
|
|---|
| | | | | * that both that copyright notice and this permission notice appear
|
|---|
| | | | | * in supporting documentation. Hewlett-Packard Company makes no
|
|---|
| | | | | * representations about the suitability of this software for any
|
|---|
| | | | | * purpose. It is provided "as is" without express or implied warranty.
|
|---|
| | | | | *
|
|---|
| | | | | *
|
|---|
| | | | | * Copyright (c) 1996
|
|---|
| | | | | * Silicon Graphics Computer Systems, Inc.
|
|---|
| | | | | *
|
|---|
| | | | | * Permission to use, copy, modify, distribute and sell this software
|
|---|
| | | | | * and its documentation for any purpose is hereby granted without fee,
|
|---|
| | | | | * provided that the above copyright notice appear in all copies and
|
|---|
| | | | | * that both that copyright notice and this permission notice appear
|
|---|
| | | | | * in supporting documentation. Silicon Graphics makes no
|
|---|
| | | | | * representations about the suitability of this software for any
|
|---|
| | | | | * purpose. It is provided "as is" without express or implied warranty.
|
|---|
| | | | | */
|
|---|
| | | | |
|
|---|
| | | | | /** @file bits/stl_vector.h
|
|---|
| | | | | * This is an internal header file, included by other library headers.
|
|---|
| | | | | * Do not attempt to use it directly. @headername{vector}
|
|---|
| | | | | */
|
|---|
| | | | |
|
|---|
| | | | | #ifndef _STL_VECTOR_H
|
|---|
| | | | | #define _STL_VECTOR_H _STL_VECTOR_H 1
_STL_VECTOR_H 1
|
|---|
| | | | |
|
|---|
| | | | | #include <bits/stl_iterator_base_funcs.h>
|
|---|
| | | | | #include <bits/functexcept.h>
|
|---|
| | | | | #include <bits/concept_check.h>
|
|---|
| | | | | #if __cplusplus __cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
__cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
|
|---|
| | | | | #include <initializer_list>
|
|---|
| | | | | #endif
|
|---|
| | | | |
|
|---|
| | | | | #include <debug/assertions.h>
|
|---|
| | | | |
|
|---|
| | | | | #if _GLIBCXX_SANITIZE_STD_ALLOCATOR _GLIBCXX_SANITIZE_STD_ALLOCATOR && _GLIBCXX_SANITIZE_STD_ALLOCATOR && _GLIBCXX_SANITIZE_VECTOR
_GLIBCXX_SANITIZE_STD_ALLOCATOR && _GLIBCXX_SANITIZE_VECTOR
_GLIBCXX_SANITIZE_STD_ALLOCATOR && _GLIBCXX_SANITIZE_STD_ALLOCATOR && _GLIBCXX_SANITIZE_VECTOR
_GLIBCXX_SANITIZE_STD_ALLOCATOR && _GLIBCXX_SANITIZE_VECTOR
|
|---|
| | | | | extern "C" void
|
|---|
| | | | | __sanitizer_annotate_contiguous_container(const void*, const void*,
|
|---|
| | | | | const void*, const void*);
|
|---|
| | | | | #endif
|
|---|
| | | | |
|
|---|
| | | | | namespace std _GLIBCXX_VISIBILITY(default)
|
|---|
| | | | | {
|
|---|
| | | | | _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
|---|
| | | | | _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
|
|---|
| | | | |
|
|---|
| | | | | /
|
|---|
| | | | | template<typename _Tp, typename _Alloc>
|
|---|
| | | | | struct _Vector_base
|
|---|
| | | | | {
|
|---|
| | | | | typedef typename __gnu_<span class="namespc">cxx</span>::__alloc_traits<_Alloc>::template
|
|---|
| | | | | rebind<_Tp>::other _Tp_alloc_type;
|
|---|
| | | | | typedef typename __gnu_<span class="namespc">cxx</span>::__alloc_traits<_Tp_alloc_type>::pointer
|
|---|
| | | | | pointer;
|
|---|
| | | | |
|
|---|
| | | | | struct _Vector_impl_data
|
|---|
| | | | | {
|
|---|
| | | | | pointer _M_start;
|
|---|
| | | | | pointer _M_finish;
|
|---|
| | | | | pointer _M_end_of_storage;
|
|---|
| | | | |
|
|---|
| | | | | _Vector_impl_data() _GLIBCXX_NOEXCEPT
|
|---|
| | | | | : _M_start(), _M_finish(), _M_end_of_storage()
|
|---|
| | | | | { }
|
|---|
| | | | |
|
|---|
| | | | | #if __cplusplus __cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
__cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
|
|---|
| | | | | _Vector_impl_data(_Vector_impl_data&& __x) noexcept
|
|---|
| | | | | : _M_start(__x._M_start), _M_finish(__x._M_finish),
|
|---|
| | | | | _M_end_of_storage(__x._M_end_of_storage)
|
|---|
| | | | | { __x._M_start = __x._M_finish = __x._M_end_of_storage = pointer(); }
|
|---|
| | | | | #endif
|
|---|
| | | | |
|
|---|
| | | | | void
|
|---|
| | | | | _M_copy_data(_Vector_impl_data const& __x) _GLIBCXX_NOEXCEPT
|
|---|
| | | | | {
|
|---|
| | | | | _M_start = __x._M_start;
|
|---|
| | | | | _M_finish = __x._M_finish;
|
|---|
| | | | | _M_end_of_storage = __x._M_end_of_storage;
|
|---|
| | | | | }
|
|---|
| | | | |
|
|---|
| | | | | void
|
|---|
| | | | | _M_swap_data(_Vector_impl_data& __x) _GLIBCXX_NOEXCEPT
|
|---|
| | | | | {
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | | _Vector_impl_data __tmp;
|
|---|
| | | | | __tmp._M_copy_data(*this);
|
|---|
| | | | | _M_copy_data(__x);
|
|---|
| | | | | __x._M_copy_data(__tmp);
|
|---|
| | | | | }
|
|---|
| | | | | };
|
|---|
| | | | |
|
|---|
| 401755 | 90 | nop | | | |
|---|
| | | | |
|---|
| _ZNSt12_Vector_baseINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EEC1Ev | | | | | |
|---|
| | | | | : public _Tp_alloc_type, public _Vector_impl_data
|
|---|
| | | | | {
|
|---|
| | | | | _Vector_impl() _GLIBCXX_NOEXCEPT_IF(
|
|---|
| | | | | is_nothrow_default_constructible<_Tp_alloc_type>::value)
|
|---|
| | | | | : _Tp_alloc_type()
|
|---|
| | | | | { }
|
|---|
| | | | |
|
|---|
| | | | | _Vector_impl(_Tp_alloc_type const& __a) _GLIBCXX_NOEXCEPT
|
|---|
| | | | | : _Tp_alloc_type(__a)
|
|---|
| | | | | { }
|
|---|
| | | | |
|
|---|
| | | | | #if __cplusplus __cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
__cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | | _Vector_impl(_Vector_impl&& __x) noexcept
|
|---|
| | | | | : _Tp_alloc_type(std::move(__x)), _Vector_impl_data(std::move(__x))
|
|---|
| | | | | { }
|
|---|
| | | | |
|
|---|
| | | | | _Vector_impl(_Tp_alloc_type&& __a) noexcept
|
|---|
| | | | | : _Tp_alloc_type(std::move(__a))
|
|---|
| | | | | { }
|
|---|
| | | | |
|
|---|
| | | | | _Vector_impl(_Tp_alloc_type&& __a, _Vector_impl&& __rv) noexcept
|
|---|
| | | | | : _Tp_alloc_type(std::move(__a)), _Vector_impl_data(std::move(__rv))
|
|---|
| | | | | { }
|
|---|
| | | | | #endif
|
|---|
| | | | |
|
|---|
| | | | | #if _GLIBCXX_SANITIZE_STD_ALLOCATOR _GLIBCXX_SANITIZE_STD_ALLOCATOR && _GLIBCXX_SANITIZE_STD_ALLOCATOR && _GLIBCXX_SANITIZE_VECTOR
_GLIBCXX_SANITIZE_STD_ALLOCATOR && _GLIBCXX_SANITIZE_VECTOR
_GLIBCXX_SANITIZE_STD_ALLOCATOR && _GLIBCXX_SANITIZE_STD_ALLOCATOR && _GLIBCXX_SANITIZE_VECTOR
_GLIBCXX_SANITIZE_STD_ALLOCATOR && _GLIBCXX_SANITIZE_VECTOR
|
|---|
| | | | | template<typename = _Tp_alloc_type>
|
|---|
| | | | | struct _Asan
|
|---|
| | | | | {
|
|---|
| | | | | typedef typename __gnu_cxx::__alloc_traits<_Tp_alloc_type>
|
|---|
| | | | | ::size_type size_type;
|
|---|
| | | | |
|
|---|
| | | | | static void _S_shrink(_Vector_impl&, size_type) { }
|
|---|
| | | | | static void _S_on_dealloc(_Vector_impl&) { }
|
|---|
| | | | |
|
|---|
| | | | | typedef _Vector_impl& _Reinit;
|
|---|
| | | | |
|
|---|
| | | | | struct _Grow
|
|---|
| | | | | {
|
|---|
| | | | | _Grow(_Vector_impl&, size_type) { }
|
|---|
| | | | | void _M_grew(size_type) { }
|
|---|
| | | | | };
|
|---|
| | | | | };
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | | template<typename _Up>
|
|---|
| | | | | struct _Asan<allocator<_Up> >
|
|---|
| | | | | {
|
|---|
| | | | | typedef typename __gnu_cxx::__alloc_traits<_Tp_alloc_type>
|
|---|
| | | | | ::size_type size_type;
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | | static void
|
|---|
| | | | | _S_adjust(_Vector_impl& __impl, pointer __prev, pointer __curr)
|
|---|
| | | | | {
|
|---|
| | | | | __sanitizer_annotate_contiguous_container(__impl._M_start,
|
|---|
| | | | | __impl._M_end_of_storage, __prev, __curr);
|
|---|
| | | | | }
|
|---|
| | | | |
|
|---|
| | | | | static void
|
|---|
| | | | | _S_grow(_Vector_impl& __impl, size_type __n)
|
|---|
| | | | | { _S_adjust(__impl, __impl._M_finish, __impl._M_finish + __n); }
|
|---|
| | | | |
|
|---|
| | | | | static void
|
|---|
| | | | | _S_shrink(_Vector_impl& __impl, size_type __n)
|
|---|
| | | | | { _S_adjust(__impl, __impl._M_finish + __n, __impl._M_finish); }
|
|---|
| | | | |
|
|---|
| | | | | static void
|
|---|
| | | | | _S_on_dealloc(_Vector_impl& __impl)
|
|---|
| | | | | {
|
|---|
| | | | | if (__impl._M_start)
|
|---|
| | | | | _S_adjust(__impl, __impl._M_finish, __impl._M_end_of_storage);
|
|---|
| | | | | }
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | | struct _Reinit
|
|---|
| | | | | {
|
|---|
| | | | | explicit _Reinit(_Vector_impl& __impl) : _M_impl(__impl)
|
|---|
| | | | | {
|
|---|
| | | | |
|
|---|
| | | | | _S_on_dealloc(_M_impl);
|
|---|
| | | | | }
|
|---|
| | | | |
|
|---|
| | | | | ~_Reinit()
|
|---|
| | | | | {
|
|---|
| | | | |
|
|---|
| | | | | if (_M_impl._M_start)
|
|---|
| | | | | _S_adjust(_M_impl, _M_impl._M_end_of_storage,
|
|---|
| | | | | _M_impl._M_finish);
|
|---|
| | | | | }
|
|---|
| | | | |
|
|---|
| | | | | _Vector_impl& _M_impl;
|
|---|
| | | | |
|
|---|
| | | | | #if __cplusplus __cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
__cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
|
|---|
| | | | | _Reinit(const _Reinit&) = delete;
|
|---|
| | | | | _Reinit& operator=(const _Reinit&) = delete;
|
|---|
| | | | | #endif
|
|---|
| | | | | };
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | | struct _Grow
|
|---|
| | | | | {
|
|---|
| | | | | _Grow(_Vector_impl& __impl, size_type __n)
|
|---|
| | | | | : _M_impl(__impl), _M_n(__n)
|
|---|
| | | | | { _S_grow(_M_impl, __n); }
|
|---|
| | | | |
|
|---|
| | | | | ~_Grow() { if (_M_n) _S_shrink(_M_impl, _M_n); }
|
|---|
| | | | |
|
|---|
| | | | | void _M_grew(size_type __n) { _M_n -= __n; }
|
|---|
| | | | |
|
|---|
| | | | | #if __cplusplus __cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
__cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
|
|---|
| | | | | _Grow(const _Grow&) = delete;
|
|---|
| | | | | _Grow& operator=(const _Grow&) = delete;
|
|---|
| | | | | #endif
|
|---|
| | | | | private:
|
|---|
| | | | | _Vector_impl& _M_impl;
|
|---|
| | | | | size_type _M_n;
|
|---|
| | | | | };
|
|---|
| | | | | };
|
|---|
| | | | |
|
|---|
| | | | | #define _GLIBCXX_ASAN_ANNOTATE_REINIT _GLIBCXX_ASAN_ANNOTATE_REINIT \
_GLIBCXX_ASAN_ANNOTATE_REINIT \
|
|---|
| | | | | typename _<span class="namespc">Base</span>::_Vector_<span class="namespc">impl</span>::template _Asan<>::_Reinit const \
|
|---|
| | | | | __attribute__((__unused__)) __reinit_guard(this->_M_impl)
|
|---|
| | | | | #define _GLIBCXX_ASAN_ANNOTATE_GROW(n) _GLIBCXX_ASAN_ANNOTATE_GROW(n) \
_GLIBCXX_ASAN_ANNOTATE_GROW(n) \
|
|---|
| | | | | typename _<span class="namespc">Base</span>::_Vector_<span class="namespc">impl</span>::template _Asan<>::_Grow \
|
|---|
| | | | | __attribute__((__unused__)) __grow_guard(this->_M_impl, (n))
|
|---|
| | | | | #define _GLIBCXX_ASAN_ANNOTATE_GREW(n) _GLIBCXX_ASAN_ANNOTATE_GREW(n) __grow_guard._M_grew(n)
_GLIBCXX_ASAN_ANNOTATE_GREW(n) __grow_guard._M_grew(n)
|
|---|
| | | | | #define _GLIBCXX_ASAN_ANNOTATE_SHRINK(n) _GLIBCXX_ASAN_ANNOTATE_SHRINK(n) \
_GLIBCXX_ASAN_ANNOTATE_SHRINK(n) \
|
|---|
| | | | | _<span class="namespc">Base</span>::_Vector_<span class="namespc">impl</span>::template _Asan<>::_S_shrink(this->_M_<span class="namespc">impl</span>, n)
|
|---|
| | | | | #define _GLIBCXX_ASAN_ANNOTATE_BEFORE_DEALLOC _GLIBCXX_ASAN_ANNOTATE_BEFORE_DEALLOC \
_GLIBCXX_ASAN_ANNOTATE_BEFORE_DEALLOC \
|
|---|
| | | | | _<span class="namespc">Base</span>::_Vector_<span class="namespc">impl</span>::template _Asan<>::_S_on_dealloc(this->_M_<span class="namespc">impl</span>)
|
|---|
| | | | | #else // // ! // ! (_GLIBCXX_SANITIZE_STD_ALLOCATOR // ! (_GLIBCXX_SANITIZE_STD_ALLOCATOR &&
// ! (_GLIBCXX_SANITIZE_STD_ALLOCATOR &&
// ! (_GLIBCXX_SANITIZE_STD_ALLOCATOR // ! (_GLIBCXX_SANITIZE_STD_ALLOCATOR &&
// ! (_GLIBCXX_SANITIZE_STD_ALLOCATOR &&
// ! // ! (_GLIBCXX_SANITIZE_STD_ALLOCATOR // ! (_GLIBCXX_SANITIZE_STD_ALLOCATOR &&
// ! (_GLIBCXX_SANITIZE_STD_ALLOCATOR &&
// ! (_GLIBCXX_SANITIZE_STD_ALLOCATOR // ! (_GLIBCXX_SANITIZE_STD_ALLOCATOR &&
// ! (_GLIBCXX_SANITIZE_STD_ALLOCATOR &&
|
|---|
| | | | | #define _GLIBCXX_ASAN_ANNOTATE_REINIT
|
|---|
| | | | | #define _GLIBCXX_ASAN_ANNOTATE_GROW(n)
|
|---|
| | | | | #define _GLIBCXX_ASAN_ANNOTATE_GREW(n)
|
|---|
| | | | | #define _GLIBCXX_ASAN_ANNOTATE_SHRINK(n)
|
|---|
| | | | | #define _GLIBCXX_ASAN_ANNOTATE_BEFORE_DEALLOC
|
|---|
| | | | | #endif // // _GLIBCXX_SANITIZE_STD_ALLOCATOR // _GLIBCXX_SANITIZE_STD_ALLOCATOR &&
// _GLIBCXX_SANITIZE_STD_ALLOCATOR &&
// _GLIBCXX_SANITIZE_STD_ALLOCATOR // _GLIBCXX_SANITIZE_STD_ALLOCATOR &&
// _GLIBCXX_SANITIZE_STD_ALLOCATOR &&
|
|---|
| | | | | };
|
|---|
| | | | |
|
|---|
| | | | | public:
|
|---|
| | | | | typedef _Alloc allocator_type;
|
|---|
| | | | |
|
|---|
| | | | | _Tp_alloc_type&
|
|---|
| | | | | _M_get_Tp_allocator() _GLIBCXX_NOEXCEPT
|
|---|
| | | | | { return this->_M_impl; }
|
|---|
| | | | |
|
|---|
| | | | | const _Tp_alloc_type&
|
|---|
| | | | | _M_get_Tp_allocator() const _GLIBCXX_NOEXCEPT
|
|---|
| | | | | { return this->_M_impl; }
|
|---|
| | | | |
|
|---|
| | | | | allocator_type
|
|---|
| | | | | get_allocator() const _GLIBCXX_NOEXCEPT
|
|---|
| | | | | { return allocator_type(_M_get_Tp_allocator()); }
|
|---|
| | | | |
|
|---|
| | | | | #if __cplusplus __cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
__cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
|
|---|
| 401756 | 55 | push | %rbp | | _Vector_base() = default;
|
|---|
| | | | | : public _Tp_alloc_type, public _Vector_impl_data
|
|---|
| | | | | {
|
|---|
| | | | | _Vector_impl() _GLIBCXX_NOEXCEPT_IF(
|
|---|
| | | | | is_nothrow_default_constructible<_Tp_alloc_type>::value)
|
|---|
| | | | | : _Tp_alloc_type()
|
|---|
| | | | | { }
|
|---|
| | | | |
|
|---|
| | | | | _Vector_impl(_Tp_alloc_type const& __a) _GLIBCXX_NOEXCEPT
|
|---|
| | | | | : _Tp_alloc_type(__a)
|
|---|
| | | | | { }
|
|---|
| | | | |
|
|---|
| | | | | #if __cplusplus __cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
__cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | | _Vector_impl(_Vector_impl&& __x) noexcept
|
|---|
| | | | | : _Tp_alloc_type(std::move(__x)), _Vector_impl_data(std::move(__x))
|
|---|
| | | | | { }
|
|---|
| | | | |
|
|---|
| | | | | _Vector_impl(_Tp_alloc_type&& __a) noexcept
|
|---|
| | | | | : _Tp_alloc_type(std::move(__a))
|
|---|
| | | | | { }
|
|---|
| | | | |
|
|---|
| | | | | _Vector_impl(_Tp_alloc_type&& __a, _Vector_impl&& __rv) noexcept
|
|---|
| | | | | : _Tp_alloc_type(std::move(__a)), _Vector_impl_data(std::move(__rv))
|
|---|
| | | | | { }
|
|---|
| | | | | #endif
|
|---|
| | | | |
|
|---|
| | | | | #if _GLIBCXX_SANITIZE_STD_ALLOCATOR _GLIBCXX_SANITIZE_STD_ALLOCATOR && _GLIBCXX_SANITIZE_STD_ALLOCATOR && _GLIBCXX_SANITIZE_VECTOR
_GLIBCXX_SANITIZE_STD_ALLOCATOR && _GLIBCXX_SANITIZE_VECTOR
_GLIBCXX_SANITIZE_STD_ALLOCATOR && _GLIBCXX_SANITIZE_STD_ALLOCATOR && _GLIBCXX_SANITIZE_VECTOR
_GLIBCXX_SANITIZE_STD_ALLOCATOR && _GLIBCXX_SANITIZE_VECTOR
|
|---|
| | | | | template<typename = _Tp_alloc_type>
|
|---|
| | | | | struct _Asan
|
|---|
| | | | | {
|
|---|
| | | | | typedef typename __gnu_cxx::__alloc_traits<_Tp_alloc_type>
|
|---|
| | | | | ::size_type size_type;
|
|---|
| | | | |
|
|---|
| | | | | static void _S_shrink(_Vector_impl&, size_type) { }
|
|---|
| | | | | static void _S_on_dealloc(_Vector_impl&) { }
|
|---|
| | | | |
|
|---|
| | | | | typedef _Vector_impl& _Reinit;
|
|---|
| | | | |
|
|---|
| | | | | struct _Grow
|
|---|
| | | | | {
|
|---|
| | | | | _Grow(_Vector_impl&, size_type) { }
|
|---|
| | | | | void _M_grew(size_type) { }
|
|---|
| | | | | };
|
|---|
| | | | | };
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | | template<typename _Up>
|
|---|
| | | | | struct _Asan<allocator<_Up> >
|
|---|
| | | | | {
|
|---|
| | | | | typedef typename __gnu_cxx::__alloc_traits<_Tp_alloc_type>
|
|---|
| | | | | ::size_type size_type;
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | | static void
|
|---|
| | | | | _S_adjust(_Vector_impl& __impl, pointer __prev, pointer __curr)
|
|---|
| | | | | {
|
|---|
| | | | | __sanitizer_annotate_contiguous_container(__impl._M_start,
|
|---|
| | | | | __impl._M_end_of_storage, __prev, __curr);
|
|---|
| | | | | }
|
|---|
| | | | |
|
|---|
| | | | | static void
|
|---|
| | | | | _S_grow(_Vector_impl& __impl, size_type __n)
|
|---|
| | | | | { _S_adjust(__impl, __impl._M_finish, __impl._M_finish + __n); }
|
|---|
| | | | |
|
|---|
| | | | | static void
|
|---|
| | | | | _S_shrink(_Vector_impl& __impl, size_type __n)
|
|---|
| | | | | { _S_adjust(__impl, __impl._M_finish + __n, __impl._M_finish); }
|
|---|
| | | | |
|
|---|
| | | | | static void
|
|---|
| | | | | _S_on_dealloc(_Vector_impl& __impl)
|
|---|
| | | | | {
|
|---|
| | | | | if (__impl._M_start)
|
|---|
| | | | | _S_adjust(__impl, __impl._M_finish, __impl._M_end_of_storage);
|
|---|
| | | | | }
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | | struct _Reinit
|
|---|
| | | | | {
|
|---|
| | | | | explicit _Reinit(_Vector_impl& __impl) : _M_impl(__impl)
|
|---|
| | | | | {
|
|---|
| | | | |
|
|---|
| | | | | _S_on_dealloc(_M_impl);
|
|---|
| | | | | }
|
|---|
| | | | |
|
|---|
| | | | | ~_Reinit()
|
|---|
| | | | | {
|
|---|
| | | | |
|
|---|
| | | | | if (_M_impl._M_start)
|
|---|
| | | | | _S_adjust(_M_impl, _M_impl._M_end_of_storage,
|
|---|
| | | | | _M_impl._M_finish);
|
|---|
| | | | | }
|
|---|
| | | | |
|
|---|
| | | | | _Vector_impl& _M_impl;
|
|---|
| | | | |
|
|---|
| | | | | #if __cplusplus __cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
__cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
|
|---|
| | | | | _Reinit(const _Reinit&) = delete;
|
|---|
| | | | | _Reinit& operator=(const _Reinit&) = delete;
|
|---|
| | | | | #endif
|
|---|
| | | | | };
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | | struct _Grow
|
|---|
| | | | | {
|
|---|
| | | | | _Grow(_Vector_impl& __impl, size_type __n)
|
|---|
| | | | | : _M_impl(__impl), _M_n(__n)
|
|---|
| | | | | { _S_grow(_M_impl, __n); }
|
|---|
| | | | |
|
|---|
| | | | | ~_Grow() { if (_M_n) _S_shrink(_M_impl, _M_n); }
|
|---|
| | | | |
|
|---|
| | | | | void _M_grew(size_type __n) { _M_n -= __n; }
|
|---|
| | | | |
|
|---|
| | | | | #if __cplusplus __cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
__cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
|
|---|
| | | | | _Grow(const _Grow&) = delete;
|
|---|
| | | | | _Grow& operator=(const _Grow&) = delete;
|
|---|
| | | | | #endif
|
|---|
| | | | | private:
|
|---|
| | | | | _Vector_impl& _M_impl;
|
|---|
| | | | | size_type _M_n;
|
|---|
| | | | | };
|
|---|
| | | | | };
|
|---|
| | | | |
|
|---|
| | | | | #define _GLIBCXX_ASAN_ANNOTATE_REINIT _GLIBCXX_ASAN_ANNOTATE_REINIT \
_GLIBCXX_ASAN_ANNOTATE_REINIT \
|
|---|
| | | | | typename _<span class="namespc">Base</span>::_Vector_<span class="namespc">impl</span>::template _Asan<>::_Reinit const \
|
|---|
| | | | | __attribute__((__unused__)) __reinit_guard(this->_M_impl)
|
|---|
| | | | | #define _GLIBCXX_ASAN_ANNOTATE_GROW(n) _GLIBCXX_ASAN_ANNOTATE_GROW(n) \
_GLIBCXX_ASAN_ANNOTATE_GROW(n) \
|
|---|
| | | | | typename _<span class="namespc">Base</span>::_Vector_<span class="namespc">impl</span>::template _Asan<>::_Grow \
|
|---|
| | | | | __attribute__((__unused__)) __grow_guard(this->_M_impl, (n))
|
|---|
| | | | | #define _GLIBCXX_ASAN_ANNOTATE_GREW(n) _GLIBCXX_ASAN_ANNOTATE_GREW(n) __grow_guard._M_grew(n)
_GLIBCXX_ASAN_ANNOTATE_GREW(n) __grow_guard._M_grew(n)
|
|---|
| | | | | #define _GLIBCXX_ASAN_ANNOTATE_SHRINK(n) _GLIBCXX_ASAN_ANNOTATE_SHRINK(n) \
_GLIBCXX_ASAN_ANNOTATE_SHRINK(n) \
|
|---|
| | | | | _<span class="namespc">Base</span>::_Vector_<span class="namespc">impl</span>::template _Asan<>::_S_shrink(this->_M_<span class="namespc">impl</span>, n)
|
|---|
| | | | | #define _GLIBCXX_ASAN_ANNOTATE_BEFORE_DEALLOC _GLIBCXX_ASAN_ANNOTATE_BEFORE_DEALLOC \
_GLIBCXX_ASAN_ANNOTATE_BEFORE_DEALLOC \
|
|---|
| | | | | _<span class="namespc">Base</span>::_Vector_<span class="namespc">impl</span>::template _Asan<>::_S_on_dealloc(this->_M_<span class="namespc">impl</span>)
|
|---|
| | | | | #else // // ! // ! (_GLIBCXX_SANITIZE_STD_ALLOCATOR // ! (_GLIBCXX_SANITIZE_STD_ALLOCATOR &&
// ! (_GLIBCXX_SANITIZE_STD_ALLOCATOR &&
// ! (_GLIBCXX_SANITIZE_STD_ALLOCATOR // ! (_GLIBCXX_SANITIZE_STD_ALLOCATOR &&
// ! (_GLIBCXX_SANITIZE_STD_ALLOCATOR &&
// ! // ! (_GLIBCXX_SANITIZE_STD_ALLOCATOR // ! (_GLIBCXX_SANITIZE_STD_ALLOCATOR &&
// ! (_GLIBCXX_SANITIZE_STD_ALLOCATOR &&
// ! (_GLIBCXX_SANITIZE_STD_ALLOCATOR // ! (_GLIBCXX_SANITIZE_STD_ALLOCATOR &&
// ! (_GLIBCXX_SANITIZE_STD_ALLOCATOR &&
|
|---|
| | | | | #define _GLIBCXX_ASAN_ANNOTATE_REINIT
|
|---|
| | | | | #define _GLIBCXX_ASAN_ANNOTATE_GROW(n)
|
|---|
| | | | | #define _GLIBCXX_ASAN_ANNOTATE_GREW(n)
|
|---|
| | | | | #define _GLIBCXX_ASAN_ANNOTATE_SHRINK(n)
|
|---|
| | | | | #define _GLIBCXX_ASAN_ANNOTATE_BEFORE_DEALLOC
|
|---|
| | | | | #endif // // _GLIBCXX_SANITIZE_STD_ALLOCATOR // _GLIBCXX_SANITIZE_STD_ALLOCATOR &&
// _GLIBCXX_SANITIZE_STD_ALLOCATOR &&
// _GLIBCXX_SANITIZE_STD_ALLOCATOR // _GLIBCXX_SANITIZE_STD_ALLOCATOR &&
// _GLIBCXX_SANITIZE_STD_ALLOCATOR &&
|
|---|
| | | | | };
|
|---|
| | | | |
|
|---|
| | | | | public:
|
|---|
| | | | | typedef _Alloc allocator_type;
|
|---|
| | | | |
|
|---|
| | | | | _Tp_alloc_type&
|
|---|
| | | | | _M_get_Tp_allocator() _GLIBCXX_NOEXCEPT
|
|---|
| | | | | { return this->_M_impl; }
|
|---|
| | | | |
|
|---|
| | | | | const _Tp_alloc_type&
|
|---|
| | | | | _M_get_Tp_allocator() const _GLIBCXX_NOEXCEPT
|
|---|
| | | | | { return this->_M_impl; }
|
|---|
| | | | |
|
|---|
| | | | | allocator_type
|
|---|
| | | | | get_allocator() const _GLIBCXX_NOEXCEPT
|
|---|
| | | | | { return allocator_type(_M_get_Tp_allocator()); }
|
|---|
| | | | |
|
|---|
| | | | | #if __cplusplus __cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
__cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
|
|---|
| 401762 | 48 8b 45 f8 | mov | -0x8(%rbp),%rax | | |
|---|
| | | | | : public _Tp_alloc_type, public _Vector_impl_data
|
|---|
| | | | | {
|
|---|
| | | | | _Vector_impl() _GLIBCXX_NOEXCEPT_IF(
|
|---|
| | | | | is_nothrow_default_constructible<_Tp_alloc_type>::value)
|
|---|
| | | | | : _Tp_alloc_type()
|
|---|
| | | | | { }
|
|---|
| | | | |
|
|---|
| | | | | _Vector_impl(_Tp_alloc_type const& __a) _GLIBCXX_NOEXCEPT
|
|---|
| | | | | : _Tp_alloc_type(__a)
|
|---|
| | | | | { }
|
|---|
| | | | |
|
|---|
| | | | | #if __cplusplus __cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
__cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | | _Vector_impl(_Vector_impl&& __x) noexcept
|
|---|
| | | | | : _Tp_alloc_type(std::move(__x)), _Vector_impl_data(std::move(__x))
|
|---|
| | | | | { }
|
|---|
| | | | |
|
|---|
| | | | | _Vector_impl(_Tp_alloc_type&& __a) noexcept
|
|---|
| | | | | : _Tp_alloc_type(std::move(__a))
|
|---|
| | | | | { }
|
|---|
| | | | |
|
|---|
| | | | | _Vector_impl(_Tp_alloc_type&& __a, _Vector_impl&& __rv) noexcept
|
|---|
| | | | | : _Tp_alloc_type(std::move(__a)), _Vector_impl_data(std::move(__rv))
|
|---|
| | | | | { }
|
|---|
| | | | | #endif
|
|---|
| | | | |
|
|---|
| | | | | #if _GLIBCXX_SANITIZE_STD_ALLOCATOR _GLIBCXX_SANITIZE_STD_ALLOCATOR && _GLIBCXX_SANITIZE_STD_ALLOCATOR && _GLIBCXX_SANITIZE_VECTOR
_GLIBCXX_SANITIZE_STD_ALLOCATOR && _GLIBCXX_SANITIZE_VECTOR
_GLIBCXX_SANITIZE_STD_ALLOCATOR && _GLIBCXX_SANITIZE_STD_ALLOCATOR && _GLIBCXX_SANITIZE_VECTOR
_GLIBCXX_SANITIZE_STD_ALLOCATOR && _GLIBCXX_SANITIZE_VECTOR
|
|---|
| | | | | template<typename = _Tp_alloc_type>
|
|---|
| | | | | struct _Asan
|
|---|
| | | | | {
|
|---|
| | | | | typedef typename __gnu_cxx::__alloc_traits<_Tp_alloc_type>
|
|---|
| | | | | ::size_type size_type;
|
|---|
| | | | |
|
|---|
| | | | | static void _S_shrink(_Vector_impl&, size_type) { }
|
|---|
| | | | | static void _S_on_dealloc(_Vector_impl&) { }
|
|---|
| | | | |
|
|---|
| | | | | typedef _Vector_impl& _Reinit;
|
|---|
| | | | |
|
|---|
| | | | | struct _Grow
|
|---|
| | | | | {
|
|---|
| | | | | _Grow(_Vector_impl&, size_type) { }
|
|---|
| | | | | void _M_grew(size_type) { }
|
|---|
| | | | | };
|
|---|
| | | | | };
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | | template<typename _Up>
|
|---|
| | | | | struct _Asan<allocator<_Up> >
|
|---|
| | | | | {
|
|---|
| | | | | typedef typename __gnu_cxx::__alloc_traits<_Tp_alloc_type>
|
|---|
| | | | | ::size_type size_type;
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | | static void
|
|---|
| | | | | _S_adjust(_Vector_impl& __impl, pointer __prev, pointer __curr)
|
|---|
| | | | | {
|
|---|
| | | | | __sanitizer_annotate_contiguous_container(__impl._M_start,
|
|---|
| | | | | __impl._M_end_of_storage, __prev, __curr);
|
|---|
| | | | | }
|
|---|
| | | | |
|
|---|
| | | | | static void
|
|---|
| | | | | _S_grow(_Vector_impl& __impl, size_type __n)
|
|---|
| | | | | { _S_adjust(__impl, __impl._M_finish, __impl._M_finish + __n); }
|
|---|
| | | | |
|
|---|
| | | | | static void
|
|---|
| | | | | _S_shrink(_Vector_impl& __impl, size_type __n)
|
|---|
| | | | | { _S_adjust(__impl, __impl._M_finish + __n, __impl._M_finish); }
|
|---|
| | | | |
|
|---|
| | | | | static void
|
|---|
| | | | | _S_on_dealloc(_Vector_impl& __impl)
|
|---|
| | | | | {
|
|---|
| | | | | if (__impl._M_start)
|
|---|
| | | | | _S_adjust(__impl, __impl._M_finish, __impl._M_end_of_storage);
|
|---|
| | | | | }
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | | struct _Reinit
|
|---|
| | | | | {
|
|---|
| | | | | explicit _Reinit(_Vector_impl& __impl) : _M_impl(__impl)
|
|---|
| | | | | {
|
|---|
| | | | |
|
|---|
| | | | | _S_on_dealloc(_M_impl);
|
|---|
| | | | | }
|
|---|
| | | | |
|
|---|
| | | | | ~_Reinit()
|
|---|
| | | | | {
|
|---|
| | | | |
|
|---|
| | | | | if (_M_impl._M_start)
|
|---|
| | | | | _S_adjust(_M_impl, _M_impl._M_end_of_storage,
|
|---|
| | | | | _M_impl._M_finish);
|
|---|
| | | | | }
|
|---|
| | | | |
|
|---|
| | | | | _Vector_impl& _M_impl;
|
|---|
| | | | |
|
|---|
| | | | | #if __cplusplus __cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
__cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
|
|---|
| | | | | _Reinit(const _Reinit&) = delete;
|
|---|
| | | | | _Reinit& operator=(const _Reinit&) = delete;
|
|---|
| | | | | #endif
|
|---|
| | | | | };
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | | struct _Grow
|
|---|
| | | | | {
|
|---|
| | | | | _Grow(_Vector_impl& __impl, size_type __n)
|
|---|
| | | | | : _M_impl(__impl), _M_n(__n)
|
|---|
| | | | | { _S_grow(_M_impl, __n); }
|
|---|
| | | | |
|
|---|
| | | | | ~_Grow() { if (_M_n) _S_shrink(_M_impl, _M_n); }
|
|---|
| | | | |
|
|---|
| | | | | void _M_grew(size_type __n) { _M_n -= __n; }
|
|---|
| | | | |
|
|---|
| | | | | #if __cplusplus __cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
__cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
|
|---|
| | | | | _Grow(const _Grow&) = delete;
|
|---|
| | | | | _Grow& operator=(const _Grow&) = delete;
|
|---|
| | | | | #endif
|
|---|
| | | | | private:
|
|---|
| | | | | _Vector_impl& _M_impl;
|
|---|
| | | | | size_type _M_n;
|
|---|
| | | | | };
|
|---|
| | | | | };
|
|---|
| | | | |
|
|---|
| | | | | #define _GLIBCXX_ASAN_ANNOTATE_REINIT _GLIBCXX_ASAN_ANNOTATE_REINIT \
_GLIBCXX_ASAN_ANNOTATE_REINIT \
|
|---|
| | | | | typename _<span class="namespc">Base</span>::_Vector_<span class="namespc">impl</span>::template _Asan<>::_Reinit const \
|
|---|
| | | | | __attribute__((__unused__)) __reinit_guard(this->_M_impl)
|
|---|
| | | | | #define _GLIBCXX_ASAN_ANNOTATE_GROW(n) _GLIBCXX_ASAN_ANNOTATE_GROW(n) \
_GLIBCXX_ASAN_ANNOTATE_GROW(n) \
|
|---|
| | | | | typename _<span class="namespc">Base</span>::_Vector_<span class="namespc">impl</span>::template _Asan<>::_Grow \
|
|---|
| | | | | __attribute__((__unused__)) __grow_guard(this->_M_impl, (n))
|
|---|
| | | | | #define _GLIBCXX_ASAN_ANNOTATE_GREW(n) _GLIBCXX_ASAN_ANNOTATE_GREW(n) __grow_guard._M_grew(n)
_GLIBCXX_ASAN_ANNOTATE_GREW(n) __grow_guard._M_grew(n)
|
|---|
| | | | | #define _GLIBCXX_ASAN_ANNOTATE_SHRINK(n) _GLIBCXX_ASAN_ANNOTATE_SHRINK(n) \
_GLIBCXX_ASAN_ANNOTATE_SHRINK(n) \
|
|---|
| | | | | _<span class="namespc">Base</span>::_Vector_<span class="namespc">impl</span>::template _Asan<>::_S_shrink(this->_M_<span class="namespc">impl</span>, n)
|
|---|
| | | | | #define _GLIBCXX_ASAN_ANNOTATE_BEFORE_DEALLOC _GLIBCXX_ASAN_ANNOTATE_BEFORE_DEALLOC \
_GLIBCXX_ASAN_ANNOTATE_BEFORE_DEALLOC \
|
|---|
| | | | | _<span class="namespc">Base</span>::_Vector_<span class="namespc">impl</span>::template _Asan<>::_S_on_dealloc(this->_M_<span class="namespc">impl</span>)
|
|---|
| | | | | #else // // ! // ! (_GLIBCXX_SANITIZE_STD_ALLOCATOR // ! (_GLIBCXX_SANITIZE_STD_ALLOCATOR &&
// ! (_GLIBCXX_SANITIZE_STD_ALLOCATOR &&
// ! (_GLIBCXX_SANITIZE_STD_ALLOCATOR // ! (_GLIBCXX_SANITIZE_STD_ALLOCATOR &&
// ! (_GLIBCXX_SANITIZE_STD_ALLOCATOR &&
// ! // ! (_GLIBCXX_SANITIZE_STD_ALLOCATOR // ! (_GLIBCXX_SANITIZE_STD_ALLOCATOR &&
// ! (_GLIBCXX_SANITIZE_STD_ALLOCATOR &&
// ! (_GLIBCXX_SANITIZE_STD_ALLOCATOR // ! (_GLIBCXX_SANITIZE_STD_ALLOCATOR &&
// ! (_GLIBCXX_SANITIZE_STD_ALLOCATOR &&
|
|---|
| | | | | #define _GLIBCXX_ASAN_ANNOTATE_REINIT
|
|---|
| | | | | #define _GLIBCXX_ASAN_ANNOTATE_GROW(n)
|
|---|
| | | | | #define _GLIBCXX_ASAN_ANNOTATE_GREW(n)
|
|---|
| | | | | #define _GLIBCXX_ASAN_ANNOTATE_SHRINK(n)
|
|---|
| | | | | #define _GLIBCXX_ASAN_ANNOTATE_BEFORE_DEALLOC
|
|---|
| | | | | #endif // // _GLIBCXX_SANITIZE_STD_ALLOCATOR // _GLIBCXX_SANITIZE_STD_ALLOCATOR &&
// _GLIBCXX_SANITIZE_STD_ALLOCATOR &&
// _GLIBCXX_SANITIZE_STD_ALLOCATOR // _GLIBCXX_SANITIZE_STD_ALLOCATOR &&
// _GLIBCXX_SANITIZE_STD_ALLOCATOR &&
|
|---|
| | | | | };
|
|---|
| | | | |
|
|---|
| | | | | public:
|
|---|
| | | | | typedef _Alloc allocator_type;
|
|---|
| | | | |
|
|---|
| | | | | _Tp_alloc_type&
|
|---|
| | | | | _M_get_Tp_allocator() _GLIBCXX_NOEXCEPT
|
|---|
| | | | | { return this->_M_impl; }
|
|---|
| | | | |
|
|---|
| | | | | const _Tp_alloc_type&
|
|---|
| | | | | _M_get_Tp_allocator() const _GLIBCXX_NOEXCEPT
|
|---|
| | | | | { return this->_M_impl; }
|
|---|
| | | | |
|
|---|
| | | | | allocator_type
|
|---|
| | | | | get_allocator() const _GLIBCXX_NOEXCEPT
|
|---|
| | | | | { return allocator_type(_M_get_Tp_allocator()); }
|
|---|
| | | | |
|
|---|
| | | | | #if __cplusplus __cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
__cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
|
|---|
| 401771 | 90 | nop | | | |
|---|
| | | | |
|---|
| _ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EEC1Ev | | | | | |
|---|
| | | | | #else
|
|---|
| | | | | _Vector_base() { }
|
|---|
| | | | | #endif
|
|---|
| | | | |
|
|---|
| | | | | _Vector_base(const allocator_type& __a) _GLIBCXX_NOEXCEPT
|
|---|
| | | | | : _M_impl(__a) { }
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | | #if !_GLIBCXX_INLINE_VERSION
|
|---|
| | | | | _Vector_base(size_t __n)
|
|---|
| | | | | : _M_impl()
|
|---|
| | | | | { _M_create_storage(__n); }
|
|---|
| | | | | #endif
|
|---|
| | | | |
|
|---|
| | | | | _Vector_base(size_t __n, const allocator_type& __a)
|
|---|
| | | | | : _M_impl(__a)
|
|---|
| | | | | { _M_create_storage(__n); }
|
|---|
| | | | |
|
|---|
| | | | | #if __cplusplus __cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
__cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
|
|---|
| | | | | _Vector_base(_Vector_base&&) = default;
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | | # if if !_GLIBCXX_INLINE_VERSION
if !_GLIBCXX_INLINE_VERSION
|
|---|
| | | | | _Vector_base(_Tp_alloc_type&& __a) noexcept
|
|---|
| | | | | : _M_impl(std::move(__a)) { }
|
|---|
| | | | |
|
|---|
| | | | | _Vector_base(_Vector_base&& __x, const allocator_type& __a)
|
|---|
| | | | | : _M_impl(__a)
|
|---|
| | | | | {
|
|---|
| | | | | if (__x.get_allocator() == __a)
|
|---|
| | | | | this->_M_impl._M_swap_data(__x._M_impl);
|
|---|
| | | | | else
|
|---|
| | | | | {
|
|---|
| | | | | size_t __n = __x._M_impl._M_finish - __x._M_impl._M_start;
|
|---|
| | | | | _M_create_storage(__n);
|
|---|
| | | | | }
|
|---|
| | | | | }
|
|---|
| | | | | # endif
|
|---|
| | | | |
|
|---|
| | | | | _Vector_base(const allocator_type& __a, _Vector_base&& __x)
|
|---|
| | | | | : _M_impl(_Tp_alloc_type(__a), std::move(__x._M_impl))
|
|---|
| | | | | { }
|
|---|
| | | | | #endif
|
|---|
| | | | |
|
|---|
| | | | | ~_Vector_base() _GLIBCXX_NOEXCEPT
|
|---|
| | | | | {
|
|---|
| | | | | _M_deallocate(_M_impl._M_start,
|
|---|
| | | | | _M_impl._M_end_of_storage - _M_impl._M_start);
|
|---|
| | | | | }
|
|---|
| | | | |
|
|---|
| | | | | public:
|
|---|
| | | | | _Vector_impl _M_impl;
|
|---|
| | | | |
|
|---|
| | | | | pointer
|
|---|
| | | | | _M_allocate(size_t __n)
|
|---|
| | | | | {
|
|---|
| | | | | typedef __gnu_cxx::__alloc_traits<_Tp_alloc_type> _Tr;
|
|---|
| | | | | return __n != 0 ? _Tr::allocate(_M_impl, __n) : pointer();
|
|---|
| | | | | }
|
|---|
| | | | |
|
|---|
| | | | | void
|
|---|
| | | | | _M_deallocate(pointer __p, size_t __n)
|
|---|
| | | | | {
|
|---|
| | | | | typedef __gnu_cxx::__alloc_traits<_Tp_alloc_type> _Tr;
|
|---|
| | | | | if (__p)
|
|---|
| | | | | _Tr::deallocate(_M_impl, __p, __n);
|
|---|
| | | | | }
|
|---|
| | | | |
|
|---|
| | | | | protected:
|
|---|
| | | | | void
|
|---|
| | | | | _M_create_storage(size_t __n)
|
|---|
| | | | | {
|
|---|
| | | | | this->_M_impl._M_start = this->_M_allocate(__n);
|
|---|
| | | | | this->_M_impl._M_finish = this->_M_impl._M_start;
|
|---|
| | | | | this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n;
|
|---|
| | | | | }
|
|---|
| | | | | };
|
|---|
| | | | |
|
|---|
| | | | | /**
|
|---|
| | | | | * @brief A standard container which offers fixed time access to
|
|---|
| | | | | * individual elements in any order.
|
|---|
| | | | | *
|
|---|
| | | | | * @ingroup sequences
|
|---|
| | | | | *
|
|---|
| | | | | * @tparam _Tp Type of element.
|
|---|
| | | | | * @tparam _Alloc Allocator type, defaults to allocator<_Tp>.
|
|---|
| | | | | *
|
|---|
| | | | | * Meets the requirements of a <a href="tables.html#65">container</a>, a
|
|---|
| | | | | * <a href="tables.html#66">reversible container</a>, and a
|
|---|
| | | | | * <a href="tables.html#67">sequence</a>, including the
|
|---|
| | | | | * <a href="tables.html#68">optional sequence requirements</a> with the
|
|---|
| | | | | * %exception of @c push_front and @c pop_front.
|
|---|
| | | | | *
|
|---|
| | | | | * In some terminology a %vector can be described as a dynamic
|
|---|
| | | | | * C-style array, it offers fast and efficient access to individual
|
|---|
| | | | | * elements in any order and saves the user from worrying about
|
|---|
| | | | | * memory and size allocation. Subscripting ( @c [] ) access is
|
|---|
| | | | | * also provided as with C-style arrays.
|
|---|
| | | | | */
|
|---|
| | | | | template<typename _Tp, typename _Alloc = std::allocator<_Tp> >
|
|---|
| | | | | class vector : protected _Vector_base<_Tp, _Alloc>
|
|---|
| | | | | {
|
|---|
| | | | | #ifdef _GLIBCXX_CONCEPT_CHECKS
|
|---|
| | | | |
|
|---|
| | | | | typedef typename _Alloc::value_type _Alloc_value_type;
|
|---|
| | | | | # if if __cplusplus if __cplusplus < if __cplusplus < 201103L
if __cplusplus < 201103L
if __cplusplus < if __cplusplus < 201103L
if __cplusplus < 201103L
if __cplusplus if __cplusplus < if __cplusplus < 201103L
if __cplusplus < 201103L
< if __cplusplus < 201103L
|
|---|
| | | | | __glibcxx_class_requires(_Tp, _SGIAssignableConcept)
|
|---|
| | | | | # endif
|
|---|
| | | | | __glibcxx_class_requires2(_Tp, _Alloc_value_type, _SameTypeConcept)
|
|---|
| | | | | #endif
|
|---|
| | | | |
|
|---|
| | | | | #if __cplusplus __cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
__cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
|
|---|
| | | | | <span class="namespc"></span> <span class="namespc"></span> <span class="namespc"></span> <span class="namespc"></span> <span class="namespc"></span> <span class="namespc"></span> <span class="namespc"></span>s<span class="namespc"></span>t<span class="namespc"></span>a<span class="namespc"></span>t<span class="namespc"></span>i<span class="namespc"></span>c<span class="namespc"></span>_<span class="namespc"></span>a<span class="namespc"></span>s<span class="namespc"></span>s<span class="namespc"></span>e<span class="namespc"></span>r<span class="namespc"></span>t<span class="namespc"></span>(<span class="namespc"></span>i<span class="namespc"></span>s<span class="namespc"></span>_<span class="namespc"></span>s<span class="namespc"></span>a<span class="namespc"></span>m<span class="namespc"></span>e<span class="namespc"></span>&<span class="namespc"></span>#<span class="namespc"></span>6<span class="namespc"></span>0<span class="namespc"></span>t<span class="namespc"></span>y<span class="namespc"></span>p<span class="namespc"></span>e<span class="namespc"></span>n<span class="namespc"></span>a<span class="namespc"></span>m<span class="namespc"></span>e<span class="namespc"></span> <span class="namespc"></span>r<span class="namespc"></span>e<span class="namespc"></span>m<span class="namespc"></span>o<span class="namespc"></span>v<span class="namespc"></span>e<span class="namespc"></span>_<span class="namespc"></span>c<span class="namespc"></span>v<span class="namespc"></span>&<span class="namespc"></span>#<span class="namespc"></span>6<span class="namespc"></span>0<span class="namespc"></span>_<span class="namespc"></span>T<span class="namespc"></span>p<span class="namespc"></span>&<span class="namespc"></span>#<span class="namespc"></span>6<span class="namespc"></span>2<span class="namespc"></span>:<span class="namespc"></span>:<span class="namespc"></span>t<span class="namespc"></span>y<span class="namespc"></span>p<span class="namespc"></span>e<span class="namespc"></span>,<span class="namespc"></span> <span class="namespc"></span>_<span class="namespc"></span>T<span class="namespc"></span>p<span class="namespc"></span>&<span class="namespc"></span>#<span class="namespc"></span>6<span class="namespc"></span>2<span class="namespc"></span>:<span class="namespc"></span>:<span class="namespc"></span>v<span class="namespc"></span>a<span class="namespc"></span>l<span class="namespc"></span>u<span class="namespc"></span>e<span class="namespc"></span>,<span class="namespc"></span>
<span class="namespc"></span> |
|---|
| | | | | "std::vector must have a non-const, non-volatile value_type");
|
|---|
| | | | | # ifdef ifdef __STRICT_ANSI__
ifdef __STRICT_ANSI__
|
|---|
| | | | | static_assert(is_same<typename _<span class="namespc">Alloc</span>::value_type, _Tp>::value,
|
|---|
| | | | | "std::vector must have the same value_type as its allocator");
|
|---|
| | | | | # endif
|
|---|
| | | | | #endif
|
|---|
| | | | |
|
|---|
| | | | | typedef _Vector_base<_Tp, _Alloc> _Base;
|
|---|
| | | | | typedef typename _Base::_Tp_alloc_type _Tp_alloc_type;
|
|---|
| | | | | typedef __gnu_cxx::__alloc_traits<_Tp_alloc_type> _Alloc_traits;
|
|---|
| | | | |
|
|---|
| | | | | public:
|
|---|
| | | | | typedef _Tp value_type;
|
|---|
| | | | | typedef typename _Base::pointer pointer;
|
|---|
| | | | | typedef typename _Alloc_traits::const_pointer const_pointer;
|
|---|
| | | | | typedef typename _Alloc_traits::reference reference;
|
|---|
| | | | | typedef typename _Alloc_traits::const_reference const_reference;
|
|---|
| | | | | typedef __gnu_cxx::__normal_iterator<pointer, vector> iterator;
|
|---|
| | | | | typedef __gnu_cxx::__normal_iterator<const_pointer, vector>
|
|---|
| | | | | const_iterator;
|
|---|
| | | | | typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
|
|---|
| | | | | typedef std::reverse_iterator<iterator> reverse_iterator;
|
|---|
| | | | | typedef size_t size_type;
|
|---|
| | | | | typedef ptrdiff_t difference_type;
|
|---|
| | | | | typedef _Alloc allocator_type;
|
|---|
| | | | |
|
|---|
| | | | | private:
|
|---|
| | | | | #if __cplusplus __cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
__cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
|
|---|
| | | | | static constexpr bool
|
|---|
| | | | | _S_nothrow_relocate(true_type)
|
|---|
| | | | | {
|
|---|
| | | | | return noexcept(std::__relocate_a(std::declval<pointer>(),
|
|---|
| | | | | std::declval<pointer>(),
|
|---|
| | | | | std::declval<pointer>(),
|
|---|
| | | | | std::declval<_Tp_alloc_type&>()));
|
|---|
| | | | | }
|
|---|
| | | | |
|
|---|
| | | | | static constexpr bool
|
|---|
| | | | | _S_nothrow_relocate(false_type)
|
|---|
| | | | | { return false; }
|
|---|
| | | | |
|
|---|
| | | | | static constexpr bool
|
|---|
| | | | | _S_use_relocate()
|
|---|
| | | | | {
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | | return _S_nothrow_relocate(__is_move_insertable<_Tp_alloc_type>{});
|
|---|
| | | | | }
|
|---|
| | | | |
|
|---|
| | | | | static pointer
|
|---|
| | | | | _S_do_relocate(pointer __first, pointer __last, pointer __result,
|
|---|
| | | | | _Tp_alloc_type& __alloc, true_type) noexcept
|
|---|
| | | | | {
|
|---|
| | | | | return std::__relocate_a(__first, __last, __result, __alloc);
|
|---|
| | | | | }
|
|---|
| | | | |
|
|---|
| | | | | static pointer
|
|---|
| | | | | _S_do_relocate(pointer, pointer, pointer __result,
|
|---|
| | | | | _Tp_alloc_type&, false_type) noexcept
|
|---|
| | | | | { return __result; }
|
|---|
| | | | |
|
|---|
| | | | | static pointer
|
|---|
| | | | | _S_relocate(pointer __first, pointer __last, pointer __result,
|
|---|
| | | | | _Tp_alloc_type& __alloc) noexcept
|
|---|
| | | | | {
|
|---|
| | | | | using __do_it = __bool_constant<_S_use_relocate()>
|
|---|
| | | | | return _S_do_relocate(__first, __last, __result, __alloc, __do_it{});
|
|---|
| | | | | }
|
|---|
| | | | | #endif //
|
|---|
| | | | |
|
|---|
| | | | | protected:
|
|---|
| | | | | using _Base::_M_allocate;
|
|---|
| | | | | using _Base::_M_deallocate;
|
|---|
| | | | | using _Base::_M_impl;
|
|---|
| | | | | using _Base::_M_get_Tp_allocator;
|
|---|
| | | | |
|
|---|
| | | | | public:
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | | /**
|
|---|
| | | | | * @brief Creates a %vector with no elements.
|
|---|
| | | | | */
|
|---|
| | | | | #if __cplusplus __cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
__cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
|
|---|
| 401772 | 55 | push | %rbp | | vector() = default;
|
|---|
| | | | | #else
|
|---|
| | | | | _Vector_base() { }
|
|---|
| | | | | #endif
|
|---|
| | | | |
|
|---|
| | | | | _Vector_base(const allocator_type& __a) _GLIBCXX_NOEXCEPT
|
|---|
| | | | | : _M_impl(__a) { }
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | | #if !_GLIBCXX_INLINE_VERSION
|
|---|
| | | | | _Vector_base(size_t __n)
|
|---|
| | | | | : _M_impl()
|
|---|
| | | | | { _M_create_storage(__n); }
|
|---|
| | | | | #endif
|
|---|
| | | | |
|
|---|
| | | | | _Vector_base(size_t __n, const allocator_type& __a)
|
|---|
| | | | | : _M_impl(__a)
|
|---|
| | | | | { _M_create_storage(__n); }
|
|---|
| | | | |
|
|---|
| | | | | #if __cplusplus __cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
__cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
|
|---|
| | | | | _Vector_base(_Vector_base&&) = default;
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | | # if if !_GLIBCXX_INLINE_VERSION
if !_GLIBCXX_INLINE_VERSION
|
|---|
| | | | | _Vector_base(_Tp_alloc_type&& __a) noexcept
|
|---|
| | | | | : _M_impl(std::move(__a)) { }
|
|---|
| | | | |
|
|---|
| | | | | _Vector_base(_Vector_base&& __x, const allocator_type& __a)
|
|---|
| | | | | : _M_impl(__a)
|
|---|
| | | | | {
|
|---|
| | | | | if (__x.get_allocator() == __a)
|
|---|
| | | | | this->_M_impl._M_swap_data(__x._M_impl);
|
|---|
| | | | | else
|
|---|
| | | | | {
|
|---|
| | | | | size_t __n = __x._M_impl._M_finish - __x._M_impl._M_start;
|
|---|
| | | | | _M_create_storage(__n);
|
|---|
| | | | | }
|
|---|
| | | | | }
|
|---|
| | | | | # endif
|
|---|
| | | | |
|
|---|
| | | | | _Vector_base(const allocator_type& __a, _Vector_base&& __x)
|
|---|
| | | | | : _M_impl(_Tp_alloc_type(__a), std::move(__x._M_impl))
|
|---|
| | | | | { }
|
|---|
| | | | | #endif
|
|---|
| | | | |
|
|---|
| | | | | ~_Vector_base() _GLIBCXX_NOEXCEPT
|
|---|
| | | | | {
|
|---|
| | | | | _M_deallocate(_M_impl._M_start,
|
|---|
| | | | | _M_impl._M_end_of_storage - _M_impl._M_start);
|
|---|
| | | | | }
|
|---|
| | | | |
|
|---|
| | | | | public:
|
|---|
| | | | | _Vector_impl _M_impl;
|
|---|
| | | | |
|
|---|
| | | | | pointer
|
|---|
| | | | | _M_allocate(size_t __n)
|
|---|
| | | | | {
|
|---|
| | | | | typedef __gnu_cxx::__alloc_traits<_Tp_alloc_type> _Tr;
|
|---|
| | | | | return __n != 0 ? _Tr::allocate(_M_impl, __n) : pointer();
|
|---|
| | | | | }
|
|---|
| | | | |
|
|---|
| | | | | void
|
|---|
| | | | | _M_deallocate(pointer __p, size_t __n)
|
|---|
| | | | | {
|
|---|
| | | | | typedef __gnu_cxx::__alloc_traits<_Tp_alloc_type> _Tr;
|
|---|
| | | | | if (__p)
|
|---|
| | | | | _Tr::deallocate(_M_impl, __p, __n);
|
|---|
| | | | | }
|
|---|
| | | | |
|
|---|
| | | | | protected:
|
|---|
| | | | | void
|
|---|
| | | | | _M_create_storage(size_t __n)
|
|---|
| | | | | {
|
|---|
| | | | | this->_M_impl._M_start = this->_M_allocate(__n);
|
|---|
| | | | | this->_M_impl._M_finish = this->_M_impl._M_start;
|
|---|
| | | | | this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n;
|
|---|
| | | | | }
|
|---|
| | | | | };
|
|---|
| | | | |
|
|---|
| | | | | /**
|
|---|
| | | | | * @brief A standard container which offers fixed time access to
|
|---|
| | | | | * individual elements in any order.
|
|---|
| | | | | *
|
|---|
| | | | | * @ingroup sequences
|
|---|
| | | | | *
|
|---|
| | | | | * @tparam _Tp Type of element.
|
|---|
| | | | | * @tparam _Alloc Allocator type, defaults to allocator<_Tp>.
|
|---|
| | | | | *
|
|---|
| | | | | * Meets the requirements of a <a href="tables.html#65">container</a>, a
|
|---|
| | | | | * <a href="tables.html#66">reversible container</a>, and a
|
|---|
| | | | | * <a href="tables.html#67">sequence</a>, including the
|
|---|
| | | | | * <a href="tables.html#68">optional sequence requirements</a> with the
|
|---|
| | | | | * %exception of @c push_front and @c pop_front.
|
|---|
| | | | | *
|
|---|
| | | | | * In some terminology a %vector can be described as a dynamic
|
|---|
| | | | | * C-style array, it offers fast and efficient access to individual
|
|---|
| | | | | * elements in any order and saves the user from worrying about
|
|---|
| | | | | * memory and size allocation. Subscripting ( @c [] ) access is
|
|---|
| | | | | * also provided as with C-style arrays.
|
|---|
| | | | | */
|
|---|
| | | | | template<typename _Tp, typename _Alloc = std::allocator<_Tp> >
|
|---|
| | | | | class vector : protected _Vector_base<_Tp, _Alloc>
|
|---|
| | | | | {
|
|---|
| | | | | #ifdef _GLIBCXX_CONCEPT_CHECKS
|
|---|
| | | | |
|
|---|
| | | | | typedef typename _Alloc::value_type _Alloc_value_type;
|
|---|
| | | | | # if if __cplusplus if __cplusplus < if __cplusplus < 201103L
if __cplusplus < 201103L
if __cplusplus < if __cplusplus < 201103L
if __cplusplus < 201103L
if __cplusplus if __cplusplus < if __cplusplus < 201103L
if __cplusplus < 201103L
< if __cplusplus < 201103L
|
|---|
| | | | | __glibcxx_class_requires(_Tp, _SGIAssignableConcept)
|
|---|
| | | | | # endif
|
|---|
| | | | | __glibcxx_class_requires2(_Tp, _Alloc_value_type, _SameTypeConcept)
|
|---|
| | | | | #endif
|
|---|
| | | | |
|
|---|
| | | | | #if __cplusplus __cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
__cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
|
|---|
| | | | | <span class="namespc"></span> <span class="namespc"></span> <span class="namespc"></span> <span class="namespc"></span> <span class="namespc"></span> <span class="namespc"></span> <span class="namespc"></span>s<span class="namespc"></span>t<span class="namespc"></span>a<span class="namespc"></span>t<span class="namespc"></span>i<span class="namespc"></span>c<span class="namespc"></span>_<span class="namespc"></span>a<span class="namespc"></span>s<span class="namespc"></span>s<span class="namespc"></span>e<span class="namespc"></span>r<span class="namespc"></span>t<span class="namespc"></span>(<span class="namespc"></span>i<span class="namespc"></span>s<span class="namespc"></span>_<span class="namespc"></span>s<span class="namespc"></span>a<span class="namespc"></span>m<span class="namespc"></span>e<span class="namespc"></span>&<span class="namespc"></span>#<span class="namespc"></span>6<span class="namespc"></span>0<span class="namespc"></span>t<span class="namespc"></span>y<span class="namespc"></span>p<span class="namespc"></span>e<span class="namespc"></span>n<span class="namespc"></span>a<span class="namespc"></span>m<span class="namespc"></span>e<span class="namespc"></span> <span class="namespc"></span>r<span class="namespc"></span>e<span class="namespc"></span>m<span class="namespc"></span>o<span class="namespc"></span>v<span class="namespc"></span>e<span class="namespc"></span>_<span class="namespc"></span>c<span class="namespc"></span>v<span class="namespc"></span>&<span class="namespc"></span>#<span class="namespc"></span>6<span class="namespc"></span>0<span class="namespc"></span>_<span class="namespc"></span>T<span class="namespc"></span>p<span class="namespc"></span>&<span class="namespc"></span>#<span class="namespc"></span>6<span class="namespc"></span>2<span class="namespc"></span>:<span class="namespc"></span>:<span class="namespc"></span>t<span class="namespc"></span>y<span class="namespc"></span>p<span class="namespc"></span>e<span class="namespc"></span>,<span class="namespc"></span> <span class="namespc"></span>_<span class="namespc"></span>T<span class="namespc"></span>p<span class="namespc"></span>&<span class="namespc"></span>#<span class="namespc"></span>6<span class="namespc"></span>2<span class="namespc"></span>:<span class="namespc"></span>:<span class="namespc"></span>v<span class="namespc"></span>a<span class="namespc"></span>l<span class="namespc"></span>u<span class="namespc"></span>e<span class="namespc"></span>,<span class="namespc"></span>
<span class="namespc"></span> |
|---|
| | | | | "std::vector must have a non-const, non-volatile value_type");
|
|---|
| | | | | # ifdef ifdef __STRICT_ANSI__
ifdef __STRICT_ANSI__
|
|---|
| | | | | static_assert(is_same<typename _<span class="namespc">Alloc</span>::value_type, _Tp>::value,
|
|---|
| | | | | "std::vector must have the same value_type as its allocator");
|
|---|
| | | | | # endif
|
|---|
| | | | | #endif
|
|---|
| | | | |
|
|---|
| | | | | typedef _Vector_base<_Tp, _Alloc> _Base;
|
|---|
| | | | | typedef typename _Base::_Tp_alloc_type _Tp_alloc_type;
|
|---|
| | | | | typedef __gnu_cxx::__alloc_traits<_Tp_alloc_type> _Alloc_traits;
|
|---|
| | | | |
|
|---|
| | | | | public:
|
|---|
| | | | | typedef _Tp value_type;
|
|---|
| | | | | typedef typename _Base::pointer pointer;
|
|---|
| | | | | typedef typename _Alloc_traits::const_pointer const_pointer;
|
|---|
| | | | | typedef typename _Alloc_traits::reference reference;
|
|---|
| | | | | typedef typename _Alloc_traits::const_reference const_reference;
|
|---|
| | | | | typedef __gnu_cxx::__normal_iterator<pointer, vector> iterator;
|
|---|
| | | | | typedef __gnu_cxx::__normal_iterator<const_pointer, vector>
|
|---|
| | | | | const_iterator;
|
|---|
| | | | | typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
|
|---|
| | | | | typedef std::reverse_iterator<iterator> reverse_iterator;
|
|---|
| | | | | typedef size_t size_type;
|
|---|
| | | | | typedef ptrdiff_t difference_type;
|
|---|
| | | | | typedef _Alloc allocator_type;
|
|---|
| | | | |
|
|---|
| | | | | private:
|
|---|
| | | | | #if __cplusplus __cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
__cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
|
|---|
| | | | | static constexpr bool
|
|---|
| | | | | _S_nothrow_relocate(true_type)
|
|---|
| | | | | {
|
|---|
| | | | | return noexcept(std::__relocate_a(std::declval<pointer>(),
|
|---|
| | | | | std::declval<pointer>(),
|
|---|
| | | | | std::declval<pointer>(),
|
|---|
| | | | | std::declval<_Tp_alloc_type&>()));
|
|---|
| | | | | }
|
|---|
| | | | |
|
|---|
| | | | | static constexpr bool
|
|---|
| | | | | _S_nothrow_relocate(false_type)
|
|---|
| | | | | { return false; }
|
|---|
| | | | |
|
|---|
| | | | | static constexpr bool
|
|---|
| | | | | _S_use_relocate()
|
|---|
| | | | | {
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | | return _S_nothrow_relocate(__is_move_insertable<_Tp_alloc_type>{});
|
|---|
| | | | | }
|
|---|
| | | | |
|
|---|
| | | | | static pointer
|
|---|
| | | | | _S_do_relocate(pointer __first, pointer __last, pointer __result,
|
|---|
| | | | | _Tp_alloc_type& __alloc, true_type) noexcept
|
|---|
| | | | | {
|
|---|
| | | | | return std::__relocate_a(__first, __last, __result, __alloc);
|
|---|
| | | | | }
|
|---|
| | | | |
|
|---|
| | | | | static pointer
|
|---|
| | | | | _S_do_relocate(pointer, pointer, pointer __result,
|
|---|
| | | | | _Tp_alloc_type&, false_type) noexcept
|
|---|
| | | | | { return __result; }
|
|---|
| | | | |
|
|---|
| | | | | static pointer
|
|---|
| | | | | _S_relocate(pointer __first, pointer __last, pointer __result,
|
|---|
| | | | | _Tp_alloc_type& __alloc) noexcept
|
|---|
| | | | | {
|
|---|
| | | | | using __do_it = __bool_constant<_S_use_relocate()>
|
|---|
| | | | | return _S_do_relocate(__first, __last, __result, __alloc, __do_it{});
|
|---|
| | | | | }
|
|---|
| | | | | #endif //
|
|---|
| | | | |
|
|---|
| | | | | protected:
|
|---|
| | | | | using _Base::_M_allocate;
|
|---|
| | | | | using _Base::_M_deallocate;
|
|---|
| | | | | using _Base::_M_impl;
|
|---|
| | | | | using _Base::_M_get_Tp_allocator;
|
|---|
| | | | |
|
|---|
| | | | | public:
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | | /**
|
|---|
| | | | | * @brief Creates a %vector with no elements.
|
|---|
| | | | | */
|
|---|
| | | | | #if __cplusplus __cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
__cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
|
|---|
| 40177e | 48 8b 45 f8 | mov | -0x8(%rbp),%rax | | |
|---|
| | | | | #else
|
|---|
| | | | | _Vector_base() { }
|
|---|
| | | | | #endif
|
|---|
| | | | |
|
|---|
| | | | | _Vector_base(const allocator_type& __a) _GLIBCXX_NOEXCEPT
|
|---|
| | | | | : _M_impl(__a) { }
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | | #if !_GLIBCXX_INLINE_VERSION
|
|---|
| | | | | _Vector_base(size_t __n)
|
|---|
| | | | | : _M_impl()
|
|---|
| | | | | { _M_create_storage(__n); }
|
|---|
| | | | | #endif
|
|---|
| | | | |
|
|---|
| | | | | _Vector_base(size_t __n, const allocator_type& __a)
|
|---|
| | | | | : _M_impl(__a)
|
|---|
| | | | | { _M_create_storage(__n); }
|
|---|
| | | | |
|
|---|
| | | | | #if __cplusplus __cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
__cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
|
|---|
| | | | | _Vector_base(_Vector_base&&) = default;
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | | # if if !_GLIBCXX_INLINE_VERSION
if !_GLIBCXX_INLINE_VERSION
|
|---|
| | | | | _Vector_base(_Tp_alloc_type&& __a) noexcept
|
|---|
| | | | | : _M_impl(std::move(__a)) { }
|
|---|
| | | | |
|
|---|
| | | | | _Vector_base(_Vector_base&& __x, const allocator_type& __a)
|
|---|
| | | | | : _M_impl(__a)
|
|---|
| | | | | {
|
|---|
| | | | | if (__x.get_allocator() == __a)
|
|---|
| | | | | this->_M_impl._M_swap_data(__x._M_impl);
|
|---|
| | | | | else
|
|---|
| | | | | {
|
|---|
| | | | | size_t __n = __x._M_impl._M_finish - __x._M_impl._M_start;
|
|---|
| | | | | _M_create_storage(__n);
|
|---|
| | | | | }
|
|---|
| | | | | }
|
|---|
| | | | | # endif
|
|---|
| | | | |
|
|---|
| | | | | _Vector_base(const allocator_type& __a, _Vector_base&& __x)
|
|---|
| | | | | : _M_impl(_Tp_alloc_type(__a), std::move(__x._M_impl))
|
|---|
| | | | | { }
|
|---|
| | | | | #endif
|
|---|
| | | | |
|
|---|
| | | | | ~_Vector_base() _GLIBCXX_NOEXCEPT
|
|---|
| | | | | {
|
|---|
| | | | | _M_deallocate(_M_impl._M_start,
|
|---|
| | | | | _M_impl._M_end_of_storage - _M_impl._M_start);
|
|---|
| | | | | }
|
|---|
| | | | |
|
|---|
| | | | | public:
|
|---|
| | | | | _Vector_impl _M_impl;
|
|---|
| | | | |
|
|---|
| | | | | pointer
|
|---|
| | | | | _M_allocate(size_t __n)
|
|---|
| | | | | {
|
|---|
| | | | | typedef __gnu_cxx::__alloc_traits<_Tp_alloc_type> _Tr;
|
|---|
| | | | | return __n != 0 ? _Tr::allocate(_M_impl, __n) : pointer();
|
|---|
| | | | | }
|
|---|
| | | | |
|
|---|
| | | | | void
|
|---|
| | | | | _M_deallocate(pointer __p, size_t __n)
|
|---|
| | | | | {
|
|---|
| | | | | typedef __gnu_cxx::__alloc_traits<_Tp_alloc_type> _Tr;
|
|---|
| | | | | if (__p)
|
|---|
| | | | | _Tr::deallocate(_M_impl, __p, __n);
|
|---|
| | | | | }
|
|---|
| | | | |
|
|---|
| | | | | protected:
|
|---|
| | | | | void
|
|---|
| | | | | _M_create_storage(size_t __n)
|
|---|
| | | | | {
|
|---|
| | | | | this->_M_impl._M_start = this->_M_allocate(__n);
|
|---|
| | | | | this->_M_impl._M_finish = this->_M_impl._M_start;
|
|---|
| | | | | this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n;
|
|---|
| | | | | }
|
|---|
| | | | | };
|
|---|
| | | | |
|
|---|
| | | | | /**
|
|---|
| | | | | * @brief A standard container which offers fixed time access to
|
|---|
| | | | | * individual elements in any order.
|
|---|
| | | | | *
|
|---|
| | | | | * @ingroup sequences
|
|---|
| | | | | *
|
|---|
| | | | | * @tparam _Tp Type of element.
|
|---|
| | | | | * @tparam _Alloc Allocator type, defaults to allocator<_Tp>.
|
|---|
| | | | | *
|
|---|
| | | | | * Meets the requirements of a <a href="tables.html#65">container</a>, a
|
|---|
| | | | | * <a href="tables.html#66">reversible container</a>, and a
|
|---|
| | | | | * <a href="tables.html#67">sequence</a>, including the
|
|---|
| | | | | * <a href="tables.html#68">optional sequence requirements</a> with the
|
|---|
| | | | | * %exception of @c push_front and @c pop_front.
|
|---|
| | | | | *
|
|---|
| | | | | * In some terminology a %vector can be described as a dynamic
|
|---|
| | | | | * C-style array, it offers fast and efficient access to individual
|
|---|
| | | | | * elements in any order and saves the user from worrying about
|
|---|
| | | | | * memory and size allocation. Subscripting ( @c [] ) access is
|
|---|
| | | | | * also provided as with C-style arrays.
|
|---|
| | | | | */
|
|---|
| | | | | template<typename _Tp, typename _Alloc = std::allocator<_Tp> >
|
|---|
| | | | | class vector : protected _Vector_base<_Tp, _Alloc>
|
|---|
| | | | | {
|
|---|
| | | | | #ifdef _GLIBCXX_CONCEPT_CHECKS
|
|---|
| | | | |
|
|---|
| | | | | typedef typename _Alloc::value_type _Alloc_value_type;
|
|---|
| | | | | # if if __cplusplus if __cplusplus < if __cplusplus < 201103L
if __cplusplus < 201103L
if __cplusplus < if __cplusplus < 201103L
if __cplusplus < 201103L
if __cplusplus if __cplusplus < if __cplusplus < 201103L
if __cplusplus < 201103L
< if __cplusplus < 201103L
|
|---|
| | | | | __glibcxx_class_requires(_Tp, _SGIAssignableConcept)
|
|---|
| | | | | # endif
|
|---|
| | | | | __glibcxx_class_requires2(_Tp, _Alloc_value_type, _SameTypeConcept)
|
|---|
| | | | | #endif
|
|---|
| | | | |
|
|---|
| | | | | #if __cplusplus __cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
__cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
|
|---|
| | | | | <span class="namespc"></span> <span class="namespc"></span> <span class="namespc"></span> <span class="namespc"></span> <span class="namespc"></span> <span class="namespc"></span> <span class="namespc"></span>s<span class="namespc"></span>t<span class="namespc"></span>a<span class="namespc"></span>t<span class="namespc"></span>i<span class="namespc"></span>c<span class="namespc"></span>_<span class="namespc"></span>a<span class="namespc"></span>s<span class="namespc"></span>s<span class="namespc"></span>e<span class="namespc"></span>r<span class="namespc"></span>t<span class="namespc"></span>(<span class="namespc"></span>i<span class="namespc"></span>s<span class="namespc"></span>_<span class="namespc"></span>s<span class="namespc"></span>a<span class="namespc"></span>m<span class="namespc"></span>e<span class="namespc"></span>&<span class="namespc"></span>#<span class="namespc"></span>6<span class="namespc"></span>0<span class="namespc"></span>t<span class="namespc"></span>y<span class="namespc"></span>p<span class="namespc"></span>e<span class="namespc"></span>n<span class="namespc"></span>a<span class="namespc"></span>m<span class="namespc"></span>e<span class="namespc"></span> <span class="namespc"></span>r<span class="namespc"></span>e<span class="namespc"></span>m<span class="namespc"></span>o<span class="namespc"></span>v<span class="namespc"></span>e<span class="namespc"></span>_<span class="namespc"></span>c<span class="namespc"></span>v<span class="namespc"></span>&<span class="namespc"></span>#<span class="namespc"></span>6<span class="namespc"></span>0<span class="namespc"></span>_<span class="namespc"></span>T<span class="namespc"></span>p<span class="namespc"></span>&<span class="namespc"></span>#<span class="namespc"></span>6<span class="namespc"></span>2<span class="namespc"></span>:<span class="namespc"></span>:<span class="namespc"></span>t<span class="namespc"></span>y<span class="namespc"></span>p<span class="namespc"></span>e<span class="namespc"></span>,<span class="namespc"></span> <span class="namespc"></span>_<span class="namespc"></span>T<span class="namespc"></span>p<span class="namespc"></span>&<span class="namespc"></span>#<span class="namespc"></span>6<span class="namespc"></span>2<span class="namespc"></span>:<span class="namespc"></span>:<span class="namespc"></span>v<span class="namespc"></span>a<span class="namespc"></span>l<span class="namespc"></span>u<span class="namespc"></span>e<span class="namespc"></span>,<span class="namespc"></span>
<span class="namespc"></span> |
|---|
| | | | | "std::vector must have a non-const, non-volatile value_type");
|
|---|
| | | | | # ifdef ifdef __STRICT_ANSI__
ifdef __STRICT_ANSI__
|
|---|
| | | | | static_assert(is_same<typename _<span class="namespc">Alloc</span>::value_type, _Tp>::value,
|
|---|
| | | | | "std::vector must have the same value_type as its allocator");
|
|---|
| | | | | # endif
|
|---|
| | | | | #endif
|
|---|
| | | | |
|
|---|
| | | | | typedef _Vector_base<_Tp, _Alloc> _Base;
|
|---|
| | | | | typedef typename _Base::_Tp_alloc_type _Tp_alloc_type;
|
|---|
| | | | | typedef __gnu_cxx::__alloc_traits<_Tp_alloc_type> _Alloc_traits;
|
|---|
| | | | |
|
|---|
| | | | | public:
|
|---|
| | | | | typedef _Tp value_type;
|
|---|
| | | | | typedef typename _Base::pointer pointer;
|
|---|
| | | | | typedef typename _Alloc_traits::const_pointer const_pointer;
|
|---|
| | | | | typedef typename _Alloc_traits::reference reference;
|
|---|
| | | | | typedef typename _Alloc_traits::const_reference const_reference;
|
|---|
| | | | | typedef __gnu_cxx::__normal_iterator<pointer, vector> iterator;
|
|---|
| | | | | typedef __gnu_cxx::__normal_iterator<const_pointer, vector>
|
|---|
| | | | | const_iterator;
|
|---|
| | | | | typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
|
|---|
| | | | | typedef std::reverse_iterator<iterator> reverse_iterator;
|
|---|
| | | | | typedef size_t size_type;
|
|---|
| | | | | typedef ptrdiff_t difference_type;
|
|---|
| | | | | typedef _Alloc allocator_type;
|
|---|
| | | | |
|
|---|
| | | | | private:
|
|---|
| | | | | #if __cplusplus __cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
__cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
|
|---|
| | | | | static constexpr bool
|
|---|
| | | | | _S_nothrow_relocate(true_type)
|
|---|
| | | | | {
|
|---|
| | | | | return noexcept(std::__relocate_a(std::declval<pointer>(),
|
|---|
| | | | | std::declval<pointer>(),
|
|---|
| | | | | std::declval<pointer>(),
|
|---|
| | | | | std::declval<_Tp_alloc_type&>()));
|
|---|
| | | | | }
|
|---|
| | | | |
|
|---|
| | | | | static constexpr bool
|
|---|
| | | | | _S_nothrow_relocate(false_type)
|
|---|
| | | | | { return false; }
|
|---|
| | | | |
|
|---|
| | | | | static constexpr bool
|
|---|
| | | | | _S_use_relocate()
|
|---|
| | | | | {
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | | return _S_nothrow_relocate(__is_move_insertable<_Tp_alloc_type>{});
|
|---|
| | | | | }
|
|---|
| | | | |
|
|---|
| | | | | static pointer
|
|---|
| | | | | _S_do_relocate(pointer __first, pointer __last, pointer __result,
|
|---|
| | | | | _Tp_alloc_type& __alloc, true_type) noexcept
|
|---|
| | | | | {
|
|---|
| | | | | return std::__relocate_a(__first, __last, __result, __alloc);
|
|---|
| | | | | }
|
|---|
| | | | |
|
|---|
| | | | | static pointer
|
|---|
| | | | | _S_do_relocate(pointer, pointer, pointer __result,
|
|---|
| | | | | _Tp_alloc_type&, false_type) noexcept
|
|---|
| | | | | { return __result; }
|
|---|
| | | | |
|
|---|
| | | | | static pointer
|
|---|
| | | | | _S_relocate(pointer __first, pointer __last, pointer __result,
|
|---|
| | | | | _Tp_alloc_type& __alloc) noexcept
|
|---|
| | | | | {
|
|---|
| | | | | using __do_it = __bool_constant<_S_use_relocate()>
|
|---|
| | | | | return _S_do_relocate(__first, __last, __result, __alloc, __do_it{});
|
|---|
| | | | | }
|
|---|
| | | | | #endif //
|
|---|
| | | | |
|
|---|
| | | | | protected:
|
|---|
| | | | | using _Base::_M_allocate;
|
|---|
| | | | | using _Base::_M_deallocate;
|
|---|
| | | | | using _Base::_M_impl;
|
|---|
| | | | | using _Base::_M_get_Tp_allocator;
|
|---|
| | | | |
|
|---|
| | | | | public:
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | | /**
|
|---|
| | | | | * @brief Creates a %vector with no elements.
|
|---|
| | | | | */
|
|---|
| | | | | #if __cplusplus __cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
__cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
|
|---|
| 40178d | 90 | nop | | | |
|---|
| | | | |
|---|
| _ZNSt12_Vector_baseINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EEC1EOS7_ | | | | | |
|---|
| | | | | #else
|
|---|
| | | | | _Vector_base() { }
|
|---|
| | | | | #endif
|
|---|
| | | | |
|
|---|
| | | | | _Vector_base(const allocator_type& __a) _GLIBCXX_NOEXCEPT
|
|---|
| | | | | : _M_impl(__a) { }
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | | #if !_GLIBCXX_INLINE_VERSION
|
|---|
| | | | | _Vector_base(size_t __n)
|
|---|
| | | | | : _M_impl()
|
|---|
| | | | | { _M_create_storage(__n); }
|
|---|
| | | | | #endif
|
|---|
| | | | |
|
|---|
| | | | | _Vector_base(size_t __n, const allocator_type& __a)
|
|---|
| | | | | : _M_impl(__a)
|
|---|
| | | | | { _M_create_storage(__n); }
|
|---|
| | | | |
|
|---|
| | | | | #if __cplusplus __cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
__cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
|
|---|
| 40178e | 55 | push | %rbp | | _Vector_base(_Vector_base&&) = default;
|
|---|
| | | | | #else
|
|---|
| | | | | _Vector_base() { }
|
|---|
| | | | | #endif
|
|---|
| | | | |
|
|---|
| | | | | _Vector_base(const allocator_type& __a) _GLIBCXX_NOEXCEPT
|
|---|
| | | | | : _M_impl(__a) { }
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | | #if !_GLIBCXX_INLINE_VERSION
|
|---|
| | | | | _Vector_base(size_t __n)
|
|---|
| | | | | : _M_impl()
|
|---|
| | | | | { _M_create_storage(__n); }
|
|---|
| | | | | #endif
|
|---|
| | | | |
|
|---|
| | | | | _Vector_base(size_t __n, const allocator_type& __a)
|
|---|
| | | | | : _M_impl(__a)
|
|---|
| | | | | { _M_create_storage(__n); }
|
|---|
| | | | |
|
|---|
| | | | | #if __cplusplus __cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
__cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
|
|---|
| 40179e | 48 8b 45 f8 | mov | -0x8(%rbp),%rax | | |
|---|
| | | | |
|---|
| _ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EEC1EOS7_ | | | | | |
|---|
| | | | | #else
|
|---|
| | | | | vector() { }
|
|---|
| | | | | #endif
|
|---|
| | | | |
|
|---|
| | | | | /**
|
|---|
| | | | | * @brief Creates a %vector with no elements.
|
|---|
| | | | | * @param __a An allocator object.
|
|---|
| | | | | */
|
|---|
| | | | | explicit
|
|---|
| | | | | vector(const allocator_type& __a) _GLIBCXX_NOEXCEPT
|
|---|
| | | | | : _Base(__a) { }
|
|---|
| | | | |
|
|---|
| | | | | #if __cplusplus __cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
__cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
|
|---|
| | | | | /**
|
|---|
| | | | | * @brief Creates a %vector with default constructed elements.
|
|---|
| | | | | * @param __n The number of elements to initially create.
|
|---|
| | | | | * @param __a An allocator.
|
|---|
| | | | | *
|
|---|
| | | | | * This constructor fills the %vector with @a __n default
|
|---|
| | | | | * constructed elements.
|
|---|
| | | | | */
|
|---|
| | | | | explicit
|
|---|
| | | | | vector(size_type __n, const allocator_type& __a = allocator_type())
|
|---|
| | | | | : _Base(_S_check_init_len(__n, __a), __a)
|
|---|
| | | | | { _M_default_initialize(__n); }
|
|---|
| | | | |
|
|---|
| | | | | /**
|
|---|
| | | | | * @brief Creates a %vector with copies of an exemplar element.
|
|---|
| | | | | * @param __n The number of elements to initially create.
|
|---|
| | | | | * @param __value An element to copy.
|
|---|
| | | | | * @param __a An allocator.
|
|---|
| | | | | *
|
|---|
| | | | | * This constructor fills the %vector with @a __n copies of @a __value.
|
|---|
| | | | | */
|
|---|
| | | | | vector(size_type __n, const value_type& __value,
|
|---|
| | | | | const allocator_type& __a = allocator_type())
|
|---|
| | | | | : _Base(_S_check_init_len(__n, __a), __a)
|
|---|
| | | | | { _M_fill_initialize(__n, __value); }
|
|---|
| | | | | #else
|
|---|
| | | | | /**
|
|---|
| | | | | * @brief Creates a %vector with copies of an exemplar element.
|
|---|
| | | | | * @param __n The number of elements to initially create.
|
|---|
| | | | | * @param __value An element to copy.
|
|---|
| | | | | * @param __a An allocator.
|
|---|
| | | | | *
|
|---|
| | | | | * This constructor fills the %vector with @a __n copies of @a __value.
|
|---|
| | | | | */
|
|---|
| | | | | explicit
|
|---|
| | | | | vector(size_type __n, const value_type& __value = value_type(),
|
|---|
| | | | | const allocator_type& __a = allocator_type())
|
|---|
| | | | | : _Base(_S_check_init_len(__n, __a), __a)
|
|---|
| | | | | { _M_fill_initialize(__n, __value); }
|
|---|
| | | | | #endif
|
|---|
| | | | |
|
|---|
| | | | | /**
|
|---|
| | | | | * @brief %Vector copy constructor.
|
|---|
| | | | | * @param __x A %vector of identical element and allocator types.
|
|---|
| | | | | *
|
|---|
| | | | | * All the elements of @a __x are copied, but any unused capacity in
|
|---|
| | | | | * @a __x will not be copied
|
|---|
| | | | | * (i.e. capacity() == size() in the new %vector).
|
|---|
| | | | | *
|
|---|
| | | | | * The newly-created %vector uses a copy of the allocator object used
|
|---|
| | | | | * by @a __x (unless the allocator traits dictate a different object).
|
|---|
| | | | | */
|
|---|
| | | | | vector(const vector& __x)
|
|---|
| | | | | : _Base(__x.size(),
|
|---|
| | | | | _Alloc_traits::_S_select_on_copy(__x._M_get_Tp_allocator()))
|
|---|
| | | | | {
|
|---|
| | | | | this->_M_impl._M_finish =
|
|---|
| | | | | std::__uninitialized_copy_a(__x.begin(), __x.end(),
|
|---|
| | | | | this->_M_impl._M_start,
|
|---|
| | | | | _M_get_Tp_allocator());
|
|---|
| | | | | }
|
|---|
| | | | |
|
|---|
| | | | | #if __cplusplus __cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
__cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
|
|---|
| | | | | /**
|
|---|
| | | | | * @brief %Vector move constructor.
|
|---|
| | | | | *
|
|---|
| | | | | * The newly-created %vector contains the exact contents of the
|
|---|
| | | | | * moved instance.
|
|---|
| | | | | * The contents of the moved instance are a valid, but unspecified
|
|---|
| | | | | * %vector.
|
|---|
| | | | | */
|
|---|
| 4017b4 | 55 | push | %rbp | | vector(vector&&) noexcept = default;
|
|---|
| | | | | #else
|
|---|
| | | | | vector() { }
|
|---|
| | | | | #endif
|
|---|
| | | | |
|
|---|
| | | | | /**
|
|---|
| | | | | * @brief Creates a %vector with no elements.
|
|---|
| | | | | * @param __a An allocator object.
|
|---|
| | | | | */
|
|---|
| | | | | explicit
|
|---|
| | | | | vector(const allocator_type& __a) _GLIBCXX_NOEXCEPT
|
|---|
| | | | | : _Base(__a) { }
|
|---|
| | | | |
|
|---|
| | | | | #if __cplusplus __cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
__cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
|
|---|
| | | | | /**
|
|---|
| | | | | * @brief Creates a %vector with default constructed elements.
|
|---|
| | | | | * @param __n The number of elements to initially create.
|
|---|
| | | | | * @param __a An allocator.
|
|---|
| | | | | *
|
|---|
| | | | | * This constructor fills the %vector with @a __n default
|
|---|
| | | | | * constructed elements.
|
|---|
| | | | | */
|
|---|
| | | | | explicit
|
|---|
| | | | | vector(size_type __n, const allocator_type& __a = allocator_type())
|
|---|
| | | | | : _Base(_S_check_init_len(__n, __a), __a)
|
|---|
| | | | | { _M_default_initialize(__n); }
|
|---|
| | | | |
|
|---|
| | | | | /**
|
|---|
| | | | | * @brief Creates a %vector with copies of an exemplar element.
|
|---|
| | | | | * @param __n The number of elements to initially create.
|
|---|
| | | | | * @param __value An element to copy.
|
|---|
| | | | | * @param __a An allocator.
|
|---|
| | | | | *
|
|---|
| | | | | * This constructor fills the %vector with @a __n copies of @a __value.
|
|---|
| | | | | */
|
|---|
| | | | | vector(size_type __n, const value_type& __value,
|
|---|
| | | | | const allocator_type& __a = allocator_type())
|
|---|
| | | | | : _Base(_S_check_init_len(__n, __a), __a)
|
|---|
| | | | | { _M_fill_initialize(__n, __value); }
|
|---|
| | | | | #else
|
|---|
| | | | | /**
|
|---|
| | | | | * @brief Creates a %vector with copies of an exemplar element.
|
|---|
| | | | | * @param __n The number of elements to initially create.
|
|---|
| | | | | * @param __value An element to copy.
|
|---|
| | | | | * @param __a An allocator.
|
|---|
| | | | | *
|
|---|
| | | | | * This constructor fills the %vector with @a __n copies of @a __value.
|
|---|
| | | | | */
|
|---|
| | | | | explicit
|
|---|
| | | | | vector(size_type __n, const value_type& __value = value_type(),
|
|---|
| | | | | const allocator_type& __a = allocator_type())
|
|---|
| | | | | : _Base(_S_check_init_len(__n, __a), __a)
|
|---|
| | | | | { _M_fill_initialize(__n, __value); }
|
|---|
| | | | | #endif
|
|---|
| | | | |
|
|---|
| | | | | /**
|
|---|
| | | | | * @brief %Vector copy constructor.
|
|---|
| | | | | * @param __x A %vector of identical element and allocator types.
|
|---|
| | | | | *
|
|---|
| | | | | * All the elements of @a __x are copied, but any unused capacity in
|
|---|
| | | | | * @a __x will not be copied
|
|---|
| | | | | * (i.e. capacity() == size() in the new %vector).
|
|---|
| | | | | *
|
|---|
| | | | | * The newly-created %vector uses a copy of the allocator object used
|
|---|
| | | | | * by @a __x (unless the allocator traits dictate a different object).
|
|---|
| | | | | */
|
|---|
| | | | | vector(const vector& __x)
|
|---|
| | | | | : _Base(__x.size(),
|
|---|
| | | | | _Alloc_traits::_S_select_on_copy(__x._M_get_Tp_allocator()))
|
|---|
| | | | | {
|
|---|
| | | | | this->_M_impl._M_finish =
|
|---|
| | | | | std::__uninitialized_copy_a(__x.begin(), __x.end(),
|
|---|
| | | | | this->_M_impl._M_start,
|
|---|
| | | | | _M_get_Tp_allocator());
|
|---|
| | | | | }
|
|---|
| | | | |
|
|---|
| | | | | #if __cplusplus __cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
__cplusplus >= __cplusplus >= 201103L
__cplusplus >= 201103L
|
|---|
| | | | | /**
|
|---|
| | | | | * @brief %Vector move constructor.
|
|---|
| | | | | *
|
|---|
| | | | | * The newly-created %vector contains the exact contents of the
|
|---|
| | | | | * moved instance.
|
|---|
| | | | | * The contents of the moved instance are a valid, but unspecified
|
|---|
| | | | | * %vector.
|
|---|
| | | | | */
|
|---|
| 4017c4 | 48 8b 45 f8 | mov | -0x8(%rbp),%rax | | |
|---|
| | | | |
|---|
| _ZNSt12_Vector_baseINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE12_Vector_implC1Ev | | | | | |
|---|
| | | | | : public _Tp_alloc_type, public _Vector_impl_data
|
|---|
| | | | | {
|
|---|
| 4017da | 55 | push | %rbp | | _Vector_impl() _GLIBCXX_NOEXCEPT_IF(
|
|---|
| | | | | is_nothrow_default_constructible<_Tp_alloc_type>::value)
|
|---|
| 4017e6 | 48 8b 45 f8 | mov | -0x8(%rbp),%rax | | : _Tp_alloc_type()
|
|---|
| 4017fe | 90 | nop | | | { }
|
|---|
| 401801 | 90 | nop | | | |
|---|
| | | | |
|---|
| _ZNSaINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEED1Ev | | | | | |
|---|
| | | | | /usr/include/c++/9/bits/allocator.h |
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | |
|
|---|
| | | | | // <http:
|
|---|
| | | | |
|
|---|
| | | | | /*
|
|---|
| | | | | * Copyright (c) 1996-1997
|
|---|
| | | | | * Silicon Graphics Computer Systems, Inc.
|
|---|
| | | | | *
|
|---|
| | | | | * Permission to use, copy, modify, distribute and sell this software
|
|---|
| | | | | * and its documentation for any purpose is hereby granted without fee,
|
|---|
| | | | | * provided that the above copyright notice appear in all copies and
|
|---|
| | | | | * that both that copyright notice and this permission notice appear
|
|---|
| | | | | * in supporting documentation. Silicon Graphics makes no
|
|---|
| | | | | * representations about the suitability of this software for any
|
|---|
| | | | | * purpose. It is provided "as is" without express or implied warranty.
|
|---|
| | | | | */
|
|---|
| | | | |
|
|---|
| | | | | /** @file bits/allocator.h
|
|---|
| | | | | * This is an internal header file, included by other library headers.
|
|---|
| | | | | * Do not attempt to use it directly. @headername{memory}
|
|---|
| | | | | */
|
|---|
| | | | |
|
|---|
| | | | | #ifndef _ALLOCATOR_H
|
|---|
| | | | | #define _ALLOCATOR_H _ALLOCATOR_H 1
_ALLOCATOR_H 1
|
|---|
| | | | |
|
|---|
| | | | | <bits/c++alloca<bits/c++allocator.h> // Define the base class to <bits/c++allocator.h> |
|---|